14 #include <msgpack.hpp>
19 namespace ns_msgpack_compact
26 using PackerPtr = std::shared_ptr<::msgpack::packer<std::ostream>>;
37 template <
class... t_Args>
40 packer_ = std::make_shared<::msgpack::packer<std::ostream>>(*output_stream_);
50 namespace ns_msgpack_compact
66 impl_->packer_->pack_array(num_entries);
72 impl_->output_stream_->flush();
78 CPPUT_ASSERT(size <= std::numeric_limits<uint32_t>::max(),
"Vector is too long.");
79 impl_->packer_->pack_array(size);
83 #define ARILES2_BASIC_TYPE(type) \
84 void Writer::writeElement(const type &element, const Parameters &) \
86 impl_->packer_->pack(element); \
91 #undef ARILES2_BASIC_TYPE
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 flush()
Flush the configuration to the output.
Writer(const std::string &file_name)
Constructor.
std::shared_ptr<::msgpack::packer< std::ostream > > PackerPtr
Writer(const Writer &)=delete
void operator=(const Writer &)=delete
void makeImplPtr(t_Args &&...args)
FileVisitorImplementation(const std::string &file_name)
#define CPPUT_ASSERT(condition,...)
#define ARILES2_BASIC_TYPES_LIST
#define CPPUT_MACRO_SUBSTITUTE(macro)