diff --git a/daisi/src/manager/CMakeLists.txt b/daisi/src/manager/CMakeLists.txt index 42666d50..a8e7849a 100644 --- a/daisi/src/manager/CMakeLists.txt +++ b/daisi/src/manager/CMakeLists.txt @@ -44,6 +44,7 @@ target_sources(daisi_manager_scenariofile_component target_link_libraries(daisi_manager_scenariofile_component INTERFACE yaml-cpp + ns3::libcore ) add_library(daisi_manager_general_scenariofile INTERFACE) diff --git a/daisi/src/manager/scenariofile_component.h b/daisi/src/manager/scenariofile_component.h index 3c32f51a..78b0e895 100644 --- a/daisi/src/manager/scenariofile_component.h +++ b/daisi/src/manager/scenariofile_component.h @@ -22,8 +22,23 @@ #include #include +#include "ns3/core-module.h" + #define STRING_NAME(VAR_NAME) #VAR_NAME #define SERIALIZE_VAR(VAR) serializeType(VAR, STRING_NAME(VAR), node); +#define SERIALIZE_NS3_TIME(VAR) \ + { \ + std::string internal; \ + serializeType(internal, STRING_NAME(VAR), node); \ + VAR = ns3::Time(internal); \ + } + +#define SERIALIZE_NS3_TIME_OPTIONAL(VAR) \ + { \ + std::optional internal; \ + serializeType(internal, STRING_NAME(VAR), node); \ + if (internal) VAR = ns3::Time(internal.value()); \ + } namespace daisi {