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>
14struct CGV_API type_interface;
22#include <cgv/config/lib_end.h>
91 virtual std::string get_type_name()
const;
93 virtual std::string get_default_options()
const;
95 std::string get_name_or_type_name()
const;
97 virtual void on_register();
99 virtual void unregister();
101 virtual bool on_exit_request();
103 virtual void stream_stats(std::ostream&);
129 return dynamic_cast<T*
>(
this);
134 return dynamic_cast<const T*
>(
this);
137 virtual void update();
139 virtual void* get_user_data()
const;
156 virtual std::string get_property_declarations();
161 virtual bool set_void(
const std::string&
property,
const std::string& value_type,
const void* value_ptr);
163 virtual void on_set(
void* member_ptr);
168 virtual bool get_void(
const std::string&
property,
const std::string& value_type,
void* value_ptr);
173 virtual bool call_void(
const std::string& method,
174 const std::vector<std::string>& param_value_types,
175 const std::vector<const void*>& param_value_ptrs,
176 const std::string& result_type =
"",
177 void* result_value_ptr = 0);
185 template <
typename T>
191 template <
typename T>
201 bool is_property(
const std::string&
property_name, std::string* type_name = 0);
206 void* find_member_ptr(
const std::string&
property_name, std::string* type_name = 0);
217inline data::ref_ptr<const T, true> cast_const_helper_base::cast_const_of_base(
const base* b)
219 return base::cast_dynamic<T>(b);
224CGV_TEMPLATE
template class CGV_API std::vector<cgv::data::ref_ptr<cgv::base::base> >;
231#include <cgv/config/lib_end.h>
base class for all classes that can be registered with support for dynamic properties (see also secti...
void set(const std::string &property, const char *value)
specialization of set method to support const char* as strings
const T * get_const_interface() const
use dynamic type cast to check for the given interface
T get(const std::string &property)
query a property of the element and perform standard conversions if necessary.
data::ref_ptr< const T, true > cast_const()
const cast to arbitrary class, but use the casts to named, node and group from the interface
T * get_interface()
use dynamic type cast to check for the given interface
static data::ref_ptr< T, true > cast_dynamic(base *b)
use dynamic cast for upcast to given class
data::ref_ptr< T, true > cast()
cast to arbitrary class, but use the casts to named, node and group from the interface
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.
complete implementation of method actions that only call one method when entering a node
if you derive your class from this class, a ref_ptr will do reference counting in the inhereted ref_c...
reference counted pointer, which can work together with types that are derived from ref_counted,...
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
data::ref_ptr< const base, true > const_base_ptr
ref counted pointer to const base
cgv::data::ref_ptr< const type_interface, true > const_type_ptr
pointer to const type interface
Derive from this class to announce implementation of the method self_reflect.
traits class with a static function get_name() of type const char* that returns the type name of the ...