Skip to content
Snippets Groups Projects
Commit 3becffcd authored by Ada Böhm's avatar Ada Böhm
Browse files

RF: separating libloom and libloomw

parent ff1f1012
No related branches found
No related tags found
No related merge requests found
Showing
with 44 additions and 45 deletions
......@@ -3,12 +3,13 @@
BASE_DIR=`dirname $0`/..
LIBLOOM_DIR=${BASE_DIR}/src/libloom
LIBLOOMW_DIR=${BASE_DIR}/src/libloomw
PYTHON_DIR=${BASE_DIR}/python/loom/pb
# LIBLOOM
protoc loomcomm.proto --cpp_out=${LIBLOOM_DIR}
protoc loomplan.proto --cpp_out=${LIBLOOM_DIR}
protoc loomrun.proto --cpp_out=${LIBLOOM_DIR}/tasks
protoc loomrun.proto --cpp_out=${LIBLOOMW_DIR}/tasks
# CLIENT (Python)
protoc loomcomm.proto --python_out=${PYTHON_DIR}
......
......@@ -11,6 +11,13 @@ add_library(libloom
log.h
pbutils.h
pbutils.cpp
dictionary.cpp
dictionary.h
types.h
loomcomm.pb.h
loomcomm.pb.cc
loomplan.pb.h
loomplan.pb.cc
)
target_include_directories(libloom PUBLIC ${PROJECT_SOURCE_DIR}/src)
......
......@@ -5,8 +5,8 @@
In the current version it provides std::make_unique
*/
#ifndef LIBLOOMNET_COMPAT_H
#define LIBLOOMNET_COMPAT_H
#ifndef LIBLOOM_COMPAT_H
#define LIBLOOM_COMPAT_H
#include <cstddef>
#include <memory>
......
File moved
......@@ -8,6 +8,7 @@
#include <vector>
namespace loom {
namespace base {
/** Container for symbols */
class Dictionary {
......@@ -15,17 +16,18 @@ class Dictionary {
public:
Dictionary();
loom::Id find_symbol_or_fail(const std::string &symbol) const;
loom::Id find_symbol(const std::string &symbol) const;
loom::Id find_or_create(const std::string &symbol);
const std::string& translate(loom::Id id);
loom::base::Id find_symbol_or_fail(const std::string &symbol) const;
loom::base::Id find_symbol(const std::string &symbol) const;
loom::base::Id find_or_create(const std::string &symbol);
const std::string& translate(loom::base::Id id);
std::vector<std::string> get_all_symbols() const;
private:
std::unordered_map<std::string, loom::Id> symbol_to_id;
std::unordered_map<std::string, loom::base::Id> symbol_to_id;
};
}
}
#endif // LIBLOOM_DICTIONARY_H
#ifndef LIBLOOMNET_LISTENER_H
#define LIBLOOMNET_LISTENER_H
#ifndef LIBLOOM_LISTENER_H
#define LIBLOOM_LISTENER_H
#include "socket.h"
......@@ -31,4 +31,4 @@ protected:
}
}
#endif // LIBLOOMNET_LISTENER_H
#endif // LIBLOOM_LISTENER_H
#ifndef LIBLOOMNET_LOG_H
#define LIBLOOMNET_LOG_H
#ifndef LIBLOOM_LOG_H
#define LIBLOOM_LOG_H
#include <sys/types.h>
#include "spdlog/spdlog.h"
......
File moved
File moved
File moved
File moved
#include "pbutils.h"
#include "libloomw/loomcomm.pb.h"
#include "loomcomm.pb.h"
#include "compat.h"
......
#ifndef LOOM_SERVER_UTILS_H
#define LOOM_SERVER_UTILS_H
#ifndef LIBLOOM_UTILS_H
#define LIBLOOM_UTILS_H
#include "sendbuffer.h"
#include "socket.h"
......@@ -21,4 +21,4 @@ void send_message(loom::base::Socket &socket, ::google::protobuf::MessageLite &m
}}
#endif // LOOM_SERVER_UTILS_H
#endif // LIBLOOM_UTILS_H
#ifndef LIBLOOMNET_SENDBUFFER_H
#define LIBLOOMNET_SENDBUFFER_H
#ifndef LIBLOOM_SENDBUFFER_H
#define LIBLOOM_SENDBUFFER_H
#include <uv.h>
#include <memory>
......@@ -97,4 +97,4 @@ protected:
}}
#endif // LIBLOOMNET_SENDBUFFER_H
#endif // LIBLOOM_SENDBUFFER_H
#ifndef LIBLOOMNET_SOCKET_H
#define LIBLOOMNET_SOCKET_H
#ifndef LIBLOOM_SOCKET_H
#define LIBLOOM_SOCKET_H
#include "sendbuffer.h"
......@@ -90,4 +90,4 @@ private:
}}
#endif // LIBLOOMNET_CONNECTION_H
#endif // LIBLOOM_CONNECTION_H
......@@ -2,13 +2,12 @@
#define LIBLOOM_TYPES_H
namespace loom {
namespace base {
const int PROTOCOL_VERSION = 1;
typedef int Id;
typedef int TaskId;
typedef int DataTypeId;
}
}
#endif // LIBLOOM_TYPES_H
......@@ -30,8 +30,6 @@ add_library(libloomw
threadjob.h
ttinstance.h
taskfactory.h
dictionary.cpp
dictionary.h
data.cpp
data.h
unpacking.cpp
......@@ -41,11 +39,6 @@ add_library(libloomw
task.cpp
task.h
taskdesc.h
loomcomm.pb.h
loomcomm.pb.cc
loomplan.pb.h
loomplan.pb.cc
types.h
config.cpp
config.h
utils.h
......
#ifndef LIBLOOM_INIT_H
#define LIBLOOM_INIT_H
#ifndef LIBLOOMW_INIT_H
#define LIBLOOMW_INIT_H
#include <string>
#include <argp.h>
......@@ -48,6 +48,3 @@ private:
#endif
......@@ -37,7 +37,7 @@ bool Data::has_raw_data() const
return false;
}
Id Data::get_type_id(Worker &worker) const
base::Id Data::get_type_id(Worker &worker) const
{
return worker.get_dictionary().find_symbol(get_type_name());
}
......
#ifndef LOOM_DATA_H
#define LOOM_DATA_H
#ifndef LIBLOOMW_DATA_H
#define LIBLOOMW_DATA_H
#include "types.h"
#include "loomcomm.pb.h"
#include "libloom/loomcomm.pb.h"
#include "libloom/types.h"
#include "libloom/sendbuffer.h"
#include <uv.h>
......@@ -51,7 +51,7 @@ public:
virtual bool has_raw_data() const;
loom::Id get_type_id(Worker &worker) const;
loom::base::Id get_type_id(Worker &worker) const;
protected:
};
......@@ -72,4 +72,4 @@ typedef std::vector<std::shared_ptr<Data>> DataVector;
}
#endif // LOOM_DATA_H
#endif // LIBLOOMW_DATA_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment