summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-11 13:51:41 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-11 13:51:41 +0100
commit287bc06f77ff5e60884c1709844c5830ff7a70ce (patch)
treea232b7c099aac11d4590c16326aaee6107f0db20
parent7df5f30494b7da283164717dea9098c8d9dca77a (diff)
Added primitive Rtti Types
-rw-r--r--src/core/common/Rtti.cpp12
-rw-r--r--src/core/common/Rtti.hpp27
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;
}