35 #ifndef DATATOOLS_THINGS_H 36 #define DATATOOLS_THINGS_H 50 #include <boost/cstdint.hpp> 51 #include <boost/utility.hpp> 52 #include <boost/serialization/access.hpp> 68 :
public std::exception
76 virtual const char*
what()
const throw();
80 std::string _message_;
89 ,
private boost::noncopyable
117 virtual void tree_dump(std::ostream & out_ = std::clog,
118 const std::string & title_ =
"",
119 const std::string & indent_ =
"",
120 bool inherit_ =
false)
const;
147 things(
const std::string & name_,
const std::string & description_ =
"");
153 const std::string &
get_name()
const;
189 virtual void clear();
192 unsigned int size()
const;
198 bool has(
const std::string & name_)
const;
202 const std::string & serial_tag_)
const;
208 bool is_mutable(
const std::string & name_)
const;
211 void set_constant(
const std::string & name_,
bool const_ =
true);
220 void set_description(
const std::string & name_,
const std::string & desc_);
226 void get_names(std::vector<std::string> & names_)
const;
232 void remove(
const std::string & name_);
235 void erase(
const std::string & name_);
239 T&
add(
const std::string & name_,
const std::string & desc_ =
"",
240 bool const_ =
false);
245 T*
pop(
const std::string & name_);
249 T&
grab(
const std::string & name_);
253 bool is_a(
const std::string & name_)
const;
257 const T&
get(
const std::string & name_)
const;
261 get_entry(
const std::string & name_)
const;
270 const std::string & serial_tag_,
271 const std::string & description_ =
"",
272 bool const_ =
false);
277 const std::string & serial_tag_,
278 const std::string & description_,
282 bool entry_is_a(
const std::string & name_,
const std::string &)
const;
294 virtual void tree_dump(std::ostream & out_ = std::clog,
295 const std::string & title_ =
"",
296 const std::string & indent_ =
"",
297 bool inherit_ =
false)
const;
300 void dump(std::ostream & out_ = std::clog)
const;
304 grab(
const std::string & name_,
const std::string & serial_tag_ =
"");
308 get(
const std::string & name_,
const std::string & serial_tag_ =
"")
const;
313 void add_impl(
const std::string & name_,
315 const std::string & desc_ =
"",
316 bool const_ =
false);
322 std::string _description_;
337 #include <datatools/things-inl.h> 345 #pragma clang diagnostic push 346 #pragma clang diagnostic ignored "-Wunused-local-typedef" 348 #include <boost/serialization/export.hpp> 350 #pragma clang diagnostic pop 359 #include <boost/serialization/version.hpp> 362 #endif // DATATOOLS_THINGS_H
bool has_description() const
std::string description
Definition: things.h:124
#define DATATOOLS_SERIALIZATION_DECLARATION_ADVANCED(ClassName)
Definition: i_serializable.h:371
void set_description(const std::string &)
#define DR_CLASS_NONCOPYABLE_INIT(Introspectable)
Inform Camp that non copyable class Introspectable exists and trigger the automatic registration of d...
Definition: reflection_interface.h:158
Internal entry for serializable object stored in the thing class.
Definition: things.h:94
#define DATATOOLS_SERIALIZATION_EXT_SERIAL_TAG_DECLARATION(ClassName)
Template support for serializable type (backward compatibility support)
Definition: i_serializable.h:101
uint8_t flags
Definition: things.h:125
#define DATATOOLS_SERIALIZATION_EXT_BACKWARD_SERIAL_TAG_DECLARATION(ClassName)
Definition: i_serializable.h:180
static const char MASK_CONST
Definition: things.h:97
bool is_not_const() const
#define DATATOOLS_SERIALIZATION_BACKWARD_SERIAL_TAG_SUPPORT()
Definition: i_serializable.h:174
datatools::i_serializable * handle
Definition: things.h:126
const std::string & get_description() const
#define DR_CLASS_RTTI()
Declare Camp RTTI within class declaration.
Definition: reflection_interface.h:46
void set_const(bool const_=true)
#define BOOST_SERIALIZATION_BASIC_DECLARATION()
Definition: serialization_macros.h:62
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Main old interface method for printing.