4#include <cgv/type/variant.h>
16 bool has_changed{
false};
19 virtual const char* get_type_name()
const = 0;
20 virtual bool set(
const std::string& value_type,
const void* value_ptr) = 0;
21 virtual bool get(
const std::string& value_type,
void* value_ptr) = 0;
30 bool set(
const std::string& value_type,
const void* value_ptr)
override { cgv::type::get_variant(*ptr,value_type,value_ptr); has_changed =
true;
return true; }
31 bool get(
const std::string& value_type,
void* value_ptr)
override { cgv::type::set_variant(*ptr,value_type,value_ptr);
return true; }
40 bool set(
const std::string& value_type,
const void* value_ptr)
override {
41 if (value_type == get_type_name()) {
42 *ptr = *((
const T*) value_ptr);
46 else if (value_type ==
"string") {
51 bool get(
const std::string& value_type,
void* value_ptr)
override {
52 if (value_type == get_type_name()) {
53 *((
T*) value_ptr) = *ptr;
56 else if (value_type ==
"string") {
88 typedef std::map<std::string, abst_property_access*> map_type;
89 typedef map_type::iterator iter_type;
90 typedef map_type::const_iterator const_iter_type;
97 std::string get_type_name()
const;
101 template <
typename T>
104 void del(
const std::string&
property);
106 bool changed(
const std::string&
property)
const;
108 std::string get_property_declarations();
110 bool set_void(
const std::string&
property,
const std::string& value_type,
const void* value_ptr);
112 bool get_void(
const std::string&
property,
const std::string& value_type,
void* value_ptr);
141#include <cgv/config/lib_end.h>
implements a dynamic object, that can be composed of independent variables, which are handled as prop...
map_type property_map
store the properties as map from property name to type and pointer to instance
void add(const std::string &property, T &value)
add a property by deriving property access from type of reference value
base class for all classes that can be registered with support for dynamic properties (see also secti...
complete implementation of method actions that only call one method when entering a node
bool has_property(const std::string &options, const std::string &property, T &value, bool report_error=true)
simple parsing support to access values of properties in a string of property assignment
signed char int8_type
this type provides an 8 bit signed integer type
int int32_type
this type provides an 32 bit signed integer type
short int16_type
this type provides an 16 bit signed integer type
unsigned short uint16_type
this type provides an 16 bit unsigned integer type
unsigned long long uint64_type
this type provides an 64 bit unsigned integer type
unsigned int uint32_type
this type provides an 32 bit unsigned integer type
long long int64_type
this type provides an 64 bit signed integer type
unsigned char uint8_type
this type provides an 8 bit unsigned integer type
std::string to_string(const std::string &v, unsigned int w, unsigned int p, bool)
specialization of conversion from string to strings
bool from_string(std::string &v, const std::string &s)
specialization to extract string value from string
static const char * get_name()
return special name for standard types or type name from RTTI cleaned from keywords for all other typ...