32 #ifndef DATATOOLS_MULTI_PROPERTIES_H 33 #define DATATOOLS_MULTI_PROPERTIES_H 42 #include <boost/cstdint.hpp> 43 #include <boost/serialization/access.hpp> 123 entry(
const std::string & key_ =
"",
124 const std::string & meta_ =
"");
136 const std::string &
get_key()
const;
139 void set_key(
const std::string &);
142 const std::string &
get_meta()
const;
151 void print_tree(std::ostream & out_ = std::clog,
152 const boost::property_tree::ptree & options_ =
empty_options())
const override;
157 virtual void tree_dump(std::ostream & out_ = std::clog,
158 const std::string & title_ =
"",
159 const std::string & indent_ =
"",
160 bool inherit_ =
false)
const;
183 void _init_ (
const std::string & key_label_,
184 const std::string & meta_label_,
185 const std::string & description_,
198 const std::string & meta_label_);
202 const std::string & meta_label_,
203 const std::string & description_,
204 bool debug_ =
false);
255 uint32_t
size()
const;
264 virtual void clear();
273 const entry&
get(
const std::string & key_)
const;
279 bool has_key(
const std::string & key_)
const;
282 bool has_key_with_meta(
const std::string & key_,
const std::string & meta_)
const;
285 const std::string &
key(
int)
const;
291 std::vector<std::string>
keys()
const;
294 void keys(std::vector<std::string> & keys_)
const;
300 void ordered_keys(std::vector<std::string> & keys_)
const;
315 void add(
const std::string & key_,
316 const std::string & meta_,
320 void add(
const std::string & key_,
324 void add(
const std::string & key_,
325 const std::string & meta_ =
"");
329 const std::string & meta_ =
"");
332 void remove(
const std::string & key_);
335 void write(
const std::string & filename_,
339 void read(
const std::string & filename_, uint32_t options_ = 0);
342 void dump(std::ostream & out_ = std::clog)
const;
345 void print_tree(std::ostream & out_ = std::clog,
346 const boost::property_tree::ptree & options_ =
empty_options())
const override;
351 virtual void tree_dump(std::ostream & out_ = std::clog,
352 const std::string & title_ =
"",
353 const std::string & indent_ =
"",
354 bool inherit_ =
false)
const;
376 config(uint32_t options_ = 0,
const std::string & topic_ =
"");
403 void set_topic(
const std::string & topic_);
426 bool _skip_private_sections_;
427 bool _skip_private_properties_;
428 bool _forbid_variants_;
429 bool _header_footer_;
430 bool _requested_topic_;
433 bool _start_without_labels_;
434 bool _without_decoration_;
437 std::string _current_filename_;
438 int _current_line_number_;
445 void remove_impl(
const std::string & key_);
448 void add_impl(
const std::string & key_,
449 const std::string & meta_ =
"");
452 properties& add_impl2(
const std::string & key_,
453 const std::string & meta_ =
"");
456 void init_defaults();
461 std::string _description_;
462 std::string _key_label_;
463 std::string _meta_label_;
488 #include <boost/serialization/export.hpp> 497 #include <boost/serialization/version.hpp> 500 #endif // DATATOOLS_MULTI_PROPERTIES_H
#define DR_CLASS_INIT(Introspectable)
Inform Camp that class Introspectable exists and trigger the automatic registration of dedicated refl...
Definition: reflection_interface.h:149
#define DATATOOLS_CLONEABLE_DECLARATION(Copyable)
Definition: i_cloneable.h:113
virtual ~entry()
Destructor.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
bool has_meta() const
Check if meta information text is not empty.
const std::string & get_meta() const
Return the meta information text.
#define DATATOOLS_SERIALIZATION_DECLARATION_ADVANCED(ClassName)
Definition: i_serializable.h:371
properties & grab_properties()
Return a mutable reference to the collection of properties.
Section entry handle internal data stored within the dictionary of the multi_properties class.
Definition: multi_properties.h:117
#define DATATOOLS_SERIALIZATION_EXT_SERIAL_TAG_DECLARATION(ClassName)
Template support for serializable type (backward compatibility support)
Definition: i_serializable.h:101
entry(const std::string &key_="", const std::string &meta_="")
Constructor.
#define DATATOOLS_SERIALIZATION_EXT_BACKWARD_SERIAL_TAG_DECLARATION(ClassName)
Definition: i_serializable.h:180
void set_key(const std::string &)
Set the primary key.
void print_tree(std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const override
Smart print.
#define DATATOOLS_SERIALIZATION_BACKWARD_SERIAL_TAG_SUPPORT()
Definition: i_serializable.h:174
const properties & get_properties() const
Return a const reference to the collection of properties.
void set_meta(const std::string &)
Set the meta information text.
Utilities for logging information.
const std::string & get_key() const
Return the primary key.
#define DR_CLASS_RTTI()
Declare Camp RTTI within class declaration.
Definition: reflection_interface.h:46
#define BOOST_SERIALIZATION_BASIC_DECLARATION()
Definition: serialization_macros.h:62