37#ifndef H_OGF_GOM_REFLECTION_META_H
38#define H_OGF_GOM_REFLECTION_META_H
132 MetaType* meta_type,
const std::string& typeid_name
150 return dynamic_cast<MetaClass*
>(resolve_meta_type(type_name));
161 const std::string& typeid_name
206 typedef std::map<std::string, MetaType_var> MetaTypesTable ;
207 typedef std::map<std::string, MetaType*> TypeidNamesTable ;
209 static Meta* instance_ ;
210 MetaTypesTable type_name_to_meta_type_ ;
211 TypeidNamesTable typeid_name_to_meta_type_ ;
276 if(result ==
nullptr) {
281 if(result ==
nullptr) {
282 Logger::err(
"Meta") <<
"No MetaType for typeid "
286 ogf_assert(result !=
nullptr) ;
299 if(result ==
nullptr) {
302 if(result ==
nullptr) {
303 Logger::err(
"Meta") <<
"MetaType for typeid "
305 <<
" is not a MetaClass"
308 ogf_assert(result !=
nullptr) ;
321 if(result ==
nullptr) {
322 Logger::err(
"Meta") <<
"No Serializer for typeid "
325 Logger::err(
"Meta") <<
"type name = " <<
type()->
name()
328 ogf_assert(result !=
nullptr) ;
354 const T& value, std::string&
string
356 std::ostringstream stream ;
358 stream, (
void*)(&value)
361 string = stream.str() ;
374 const std::string&
string, T& value
376 if(
string.length() == 0) {
380 std::istringstream stream(
string) ;
382 stream, (
void*)(&value)
Creates instances of a specific class.
Abstract base class for reading and writing values from/to streams.
virtual bool serialize_read(std::istream &stream, void *addr)=0
Reads a value from a stream.
virtual bool serialize_write(std::ostream &stream, void *addr)=0
Writes a value to a stream.
Global Graphite namespace.
bool ogf_is_a(const T &x, const MetaType *type)
Tests whether the type of a variable derives from another type.
MetaType * ogf_static_type(const T &x)
Gets the MetaType associated with a variable.
bool ogf_convert_from_string(const std::string &string, T &value)
Converts a string to a variable using the reflection API.
bool ogf_convert_to_string(const T &value, std::string &string)
Converts a variable to a string using the reflection API.
MetaType * ogf_dynamic_type(const T &x)
Gets the MetaType associated with a variable.
Definitions common to all include files in the gom library.