3 #include <cgv/type/info/type_name.h>
4 #include <cgv/reflect/reflection_handler.h>
5 #include <cgv/data/ref_ptr.h>
8 #include <cgv/type/lib_begin.h>
14 struct CGV_API type_interface;
22 #include <cgv/config/lib_end.h>
24 #include "lib_begin.h"
39 struct cast_helper_base
46 struct cast_helper :
public cast_helper_base
50 return cast_of_base<T>(b);
60 friend class data::ref_ptr_impl<
base,true>;
64 friend struct cast_helper_base;
73 virtual std::string get_type_name()
const;
75 virtual std::string get_default_options()
const;
77 virtual void on_register();
79 virtual void unregister();
81 virtual void stream_stats(std::ostream&);
91 return cast_helper<T>::cast(
this);
96 return dynamic_cast<T*
>(
this);
101 return dynamic_cast<const T*
>(
this);
104 virtual void update();
106 virtual void* get_user_data()
const;
123 virtual std::string get_property_declarations();
128 virtual bool set_void(
const std::string& property,
const std::string& value_type,
const void* value_ptr);
130 virtual void on_set(
void* member_ptr);
135 virtual bool get_void(
const std::string& property,
const std::string& value_type,
void* value_ptr);
140 virtual bool call_void(
const std::string& method,
141 const std::vector<std::string>& param_value_types,
142 const std::vector<const void*>& param_value_ptrs,
143 const std::string& result_type =
"",
144 void* result_value_ptr = 0);
152 template <
typename T>
158 template <
typename T>
164 void multi_set(
const std::string& property_assignments,
bool report_error =
true);
168 bool is_property(
const std::string& property_name, std::string* type_name = 0);
173 void* find_member_ptr(
const std::string& property_name, std::string* type_name = 0);
178 template <
typename T>
181 return base::cast_dynamic<T>(b);
186 CGV_TEMPLATE
template class CGV_API std::vector<cgv::data::ref_ptr<cgv::base::base> >;
193 #include <cgv/config/lib_end.h>
T get(const std::string &property)
query a property of the element and perform standard conversions if necessary.
Definition: base.h:159
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
Definition: base.h:37
cgv::data::ref_ptr< const type_interface, true > const_type_ptr
pointer to const type interface
Definition: base.h:17
const T * get_const_interface() const
use dynamic type cast to check for the given interface
Definition: base.h:100
void set(const std::string &property, const T &value)
set a property of the element to the given value and perform standard conversions if necessary.
Definition: base.h:153
Definition: reflection_handler.h:63
Definition: ref_counted.h:11
static data::ref_ptr< T, true > cast_dynamic(base *b)
use dynamic cast for upcast to given class
Definition: base.h:67
Derive from this class to announce implementation of the method self_reflect.
Definition: self_reflection_tag.h:12
T * get_interface()
use dynamic type cast to check for the given interface
Definition: base.h:95
data::ref_ptr< T, true > cast()
cast to arbitrary class, but use the casts to named, node and group from the interface
Definition: base.h:90
void set(const std::string &property, const char *value)
specialization of set method to support const char* as strings
Definition: base.h:147
the cgv namespace
Definition: vr_calib.cxx:9
Definition: type_name.h:54