14 #include <msgpack.hpp>
27 using PackerPtr = std::shared_ptr<::msgpack::packer<std::ostream>>;
41 template <
class... t_Args>
44 packer_ = std::make_shared<::msgpack::packer<std::ostream>>(*output_stream_);
73 impl_->packer_->pack_map(num_entries);
80 impl_->packer_->pack(map_name);
87 impl_->output_stream_->flush();
94 CPPUT_ASSERT(size <= std::numeric_limits<uint32_t>::max(),
"Vector is too long.");
96 impl_->packer_->pack_array(size);
106 0 ==
impl_->nameless_counter_,
107 "Multiple nameless root entries are not supported, specify root names explicitly.");
108 ++
impl_->nameless_counter_;
109 impl_->packer_->pack_map(1);
114 impl_->packer_->pack_map(1);
126 #define ARILES2_BASIC_TYPE(type) \
127 void Writer::writeElement(const type &element, const Parameters &) \
129 CPPUT_TRACE_FUNCTION; \
130 impl_->packer_->pack(element); \
135 #undef ARILES2_BASIC_TYPE
void startMapEntry(const std::string &map_name)
Starts a nested map in the configuration file.
void startArray(const std::size_t size, const bool=false)
void startMap(const Parameters &, const std::size_t num_entries)
Starts a nested map in the configuration file.
void startRoot(const std::string &name, const Parameters &)
void flush()
Flush the configuration to the output.
Writer(const std::string &file_name)
Constructor.
void endRoot(const std::string &name)
std::size_t nameless_counter_
Writer(const Writer &)=delete
void operator=(const Writer &)=delete
std::shared_ptr<::msgpack::packer< std::ostream > > PackerPtr
void makeImplPtr(t_Args &&...args)
FileVisitorImplementation(const std::string &file_name)
virtual void endMapEntry()
#define CPPUT_ASSERT(condition,...)
#define ARILES2_BASIC_TYPES_LIST
#define CPPUT_MACRO_SUBSTITUTE(macro)
#define CPPUT_TRACE_FUNCTION
#define CPPUT_TRACE_VALUE(value)