diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a215f10..3c18179 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,11 @@ project(solanaceae) add_library(solanaceae_message_serializer ./solanaceae/message3/message_serializer.hpp ./solanaceae/message3/message_serializer.cpp + + # TODO: extract? + ./solanaceae/message3/nj/message_components.hpp + ./solanaceae/message3/nj/message_components_serializer.hpp + ./solanaceae/message3/nj/message_components_serializer.cpp ) target_include_directories(solanaceae_message_serializer PUBLIC .) diff --git a/src/solanaceae/message3/nj/message_components.hpp b/src/solanaceae/message3/nj/message_components.hpp new file mode 100644 index 0000000..f1d3ff8 --- /dev/null +++ b/src/solanaceae/message3/nj/message_components.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include + +#include + +#include + +namespace Message::Components { + + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Timestamp, ts) + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(TimestampProcessed, ts) + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(TimestampWritten, ts) + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(ContactFrom, c) + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(ContactTo, c) + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Read, ts) + // TODO: SyncedBy + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(MessageText, text) + + // TODO: remove + //namespace Transfer { + //NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(FileInfo::FileDirEntry, file_name, file_size) + //NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(FileInfo, file_list, total_size) + //NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(FileInfoLocal, file_list) + //} // Transfer + +} // Message::Components + + diff --git a/src/solanaceae/message3/nj/message_components_serializer.cpp b/src/solanaceae/message3/nj/message_components_serializer.cpp new file mode 100644 index 0000000..7f56418 --- /dev/null +++ b/src/solanaceae/message3/nj/message_components_serializer.cpp @@ -0,0 +1,34 @@ +#include "./message_components_serializer.hpp" + +#include "./message_components.hpp" + +void registerMessageComponents(MessageSerializerNJ& msnj) { + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + msnj.registerSerializer(); + msnj.registerDeserializer(); + + // files + //_sc.registerSerializerJson() + //_sc.registerSerializerJson(); + //_sc.registerDeSerializerJson(); + //_sc.registerSerializerJson(); + //_sc.registerDeSerializerJson(); + //_sc.registerSerializerJson(); + //_sc.registerDeSerializerJson(); +} + diff --git a/src/solanaceae/message3/nj/message_components_serializer.hpp b/src/solanaceae/message3/nj/message_components_serializer.hpp new file mode 100644 index 0000000..7852c28 --- /dev/null +++ b/src/solanaceae/message3/nj/message_components_serializer.hpp @@ -0,0 +1,6 @@ +#pragma once + +#include + +void registerMessageComponents(MessageSerializerNJ& msnj); +