diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/common/Rtti.cpp | 12 | ||||
| -rw-r--r-- | src/core/common/Rtti.hpp | 27 | 
2 files changed, 32 insertions, 7 deletions
diff --git a/src/core/common/Rtti.cpp b/src/core/common/Rtti.cpp index 7ee3c45..a8343ef 100644 --- a/src/core/common/Rtti.cpp +++ b/src/core/common/Rtti.cpp @@ -99,6 +99,16 @@ bool RttiType::composedOf(const RttiType &other) const  /* Constant initialization */ -const RttiType RttiTypes::None; +namespace RttiTypes { +const RttiType None{"unknown"}; +const RttiType Nullptr{"nullptr"}; +const RttiType Bool{"bool"}; +const RttiType Int{"int"}; +const RttiType Double{"double"}; +const RttiType String{"string"}; +const RttiType Array{"array"}; +const RttiType Map{"map"}; +const RttiType Function{"function"}; +}  } diff --git a/src/core/common/Rtti.hpp b/src/core/common/Rtti.hpp index aa161d6..39a61d3 100644 --- a/src/core/common/Rtti.hpp +++ b/src/core/common/Rtti.hpp @@ -296,6 +296,11 @@ public:  	RttiType() : name("unknown") {}  	/** +	 * Constructor for an empty RttiType with the given name. +	 */ +	RttiType(std::string name) : name(std::move(name)) {} + +	/**  	 * Creates a new RttiType instance and registers it in the global type  	 * table. Use the Rtti and the RttiBuilder class for more convenient  	 * registration of type information. @@ -431,32 +436,42 @@ namespace RttiTypes {  extern const RttiType None;  /** - * Bool type for use by the Variant::rttiType method. + * Nullptr type for use by the Variant::getRttiType method. + */ +extern const RttiType Nullptr; + +/** + * Bool type for use by the Variant::getRttiType method.   */  extern const RttiType Bool;  /** - * Integer type for use by the Variant::rttiType method. + * Integer type for use by the Variant::getRttiType method.   */  extern const RttiType Int;  /** - * Double type for use by the Variant::rttiType method. + * Double type for use by the Variant::getRttiType method.   */  extern const RttiType Double;  /** - * String type for use by the Variant::rttiType method. + * String type for use by the Variant::getRttiType method.   */  extern const RttiType String;  /** - * Array type for use by the Variant::rttiType method. + * Array type for use by the Variant::getRttiType method.   */  extern const RttiType Array;  /** - * Function type for use by the Variant::rttiType method. + * Map type for use by the Variant::getRttiType method. + */ +extern const RttiType Map; + +/** + * Function type for use by the Variant::getRttiType method.   */  extern const RttiType Function;  }  | 
