summaryrefslogtreecommitdiff
path: root/modules/remote-filesystem
diff options
context:
space:
mode:
Diffstat (limited to 'modules/remote-filesystem')
-rw-r--r--modules/remote-filesystem/SConstruct1
-rw-r--r--modules/remote-filesystem/c++/SConscript24
-rw-r--r--modules/remote-filesystem/c++/remote.hpp2
-rw-r--r--modules/remote-filesystem/c++/transport.hpp4
-rw-r--r--modules/remote-filesystem/tests/transport.cpp30
5 files changed, 45 insertions, 16 deletions
diff --git a/modules/remote-filesystem/SConstruct b/modules/remote-filesystem/SConstruct
index 5e94c0b..de3fadf 100644
--- a/modules/remote-filesystem/SConstruct
+++ b/modules/remote-filesystem/SConstruct
@@ -74,6 +74,7 @@ env.targets = [];
Export('env')
SConscript('c++/SConscript')
+SConscript('tests/SConscript')
SConscript('examples/SConscript')
env.Alias('cdb', env.cdb);
diff --git a/modules/remote-filesystem/c++/SConscript b/modules/remote-filesystem/c++/SConscript
index 2bf03be..621afdc 100644
--- a/modules/remote-filesystem/c++/SConscript
+++ b/modules/remote-filesystem/c++/SConscript
@@ -10,29 +10,29 @@ Import('env')
dir_path = Dir('.').abspath
# Environment for base library
-remote-filesystem_env = env.Clone();
+remote_filesystem_env = env.Clone();
-remote-filesystem_env.sources = sorted(glob.glob(dir_path + "/*.cpp"))
-remote-filesystem_env.headers = sorted(glob.glob(dir_path + "/*.hpp"))
+remote_filesystem_env.sources = sorted(glob.glob(dir_path + "/*.cpp"))
+remote_filesystem_env.headers = sorted(glob.glob(dir_path + "/*.hpp"))
-env.sources += remote-filesystem_env.sources;
-env.headers += remote-filesystem_env.headers;
+env.sources += remote_filesystem_env.sources;
+env.headers += remote_filesystem_env.headers;
## Shared lib
objects_shared = []
-remote-filesystem_env.add_source_files(objects_shared, remote-filesystem_env.sources, shared=True);
-env.library_shared = remote-filesystem_env.SharedLibrary('#build/forstio-remote-filesystem', [objects_shared]);
+remote_filesystem_env.add_source_files(objects_shared, remote_filesystem_env.sources, shared=True);
+env.library_shared = remote_filesystem_env.SharedLibrary('#build/forstio-remote_filesystem', [objects_shared]);
## Static lib
objects_static = []
-remote-filesystem_env.add_source_files(objects_static, remote-filesystem_env.sources, shared=False);
-env.library_static = remote-filesystem_env.StaticLibrary('#build/forstio-remote-filesystem', [objects_static]);
+remote_filesystem_env.add_source_files(objects_static, remote_filesystem_env.sources, shared=False);
+env.library_static = remote_filesystem_env.StaticLibrary('#build/forstio-remote_filesystem', [objects_static]);
# Set Alias
-env.Alias('library_remote-filesystem', [env.library_shared, env.library_static]);
+env.Alias('library_remote_filesystem', [env.library_shared, env.library_static]);
-env.targets += ['library_remote-filesystem'];
+env.targets += ['library_remote_filesystem'];
# Install
env.Install('$prefix/lib/', [env.library_shared, env.library_static]);
-env.Install('$prefix/include/forstio/remote/filesystem/', [remote-filesystem_env.headers]);
+env.Install('$prefix/include/forstio/remote/filesystem/', [remote_filesystem_env.headers]);
diff --git a/modules/remote-filesystem/c++/remote.hpp b/modules/remote-filesystem/c++/remote.hpp
index 062d7ee..8390501 100644
--- a/modules/remote-filesystem/c++/remote.hpp
+++ b/modules/remote-filesystem/c++/remote.hpp
@@ -41,7 +41,7 @@ public:
template<typename Schema, typename Encode>
error_or<own<data_server<Schema, Encode, rmt::File>>> data_listen(ref<remote_address<rmt::File>> addr){
- auto insert_res = registered_data_servers_.emplace(std::make_pair(addr.get_path_string(),{}));
+ auto insert_res = registered_data_servers_.emplace(std::make_pair(addr().get_path_string(),ptr<i_data_server<rmt::File>>{}));
if(!insert_res.second){
return make_error<err::already_exists>();
}
diff --git a/modules/remote-filesystem/c++/transport.hpp b/modules/remote-filesystem/c++/transport.hpp
index 367f533..0db4600 100644
--- a/modules/remote-filesystem/c++/transport.hpp
+++ b/modules/remote-filesystem/c++/transport.hpp
@@ -32,12 +32,10 @@ public:
error_or<void> send(const data<Schema, Encoding>& dat, id<Schema> store_id){
try {
}
-
return make_error<err::not_implemented>();
}
error_or<void> allocate(data<typename meta_schema<Schema>::MetaSchema, Encoding> meta, id<Schema> store_id){
-
return make_error<err::not_implemented>();
}
@@ -46,7 +44,7 @@ public:
}
error_or<data<Schema,Encoding>> receive(id<Schema> store_id){
-
+ return make_error<err::not_implemented>();
}
};
diff --git a/modules/remote-filesystem/tests/transport.cpp b/modules/remote-filesystem/tests/transport.cpp
new file mode 100644
index 0000000..05c13a6
--- /dev/null
+++ b/modules/remote-filesystem/tests/transport.cpp
@@ -0,0 +1,30 @@
+#include <forstio/test/suite.hpp>
+#include "../c++/transport.hpp"
+
+namespace {
+namespace sch {
+using namespace saw::schema;
+
+using Foo = Struct<
+ Member<String, "a">,
+ Member<Int64, "b">
+>;
+}
+
+SAW_TEST("File Remote"){
+ using namespace saw;
+
+ remote<rmt::File> file_remote;
+
+ auto eo_addr = file_remote.parse_address("./example_file");
+ SAW_EOV_EXPECT(eo_addr, "Couldn't parse file");
+ auto& addr = eo_addr.get_value();
+
+ auto eo_dat_srv = file_remote.data_listen({*addr});
+ SAW_EOV_EXPECT(eo_dat_srv, "Couldn't setup data server.");
+ auto& dat_srv = eo_dat_srv.get_value();
+
+
+}
+
+}