diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-12 15:32:51 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-12 15:32:51 +0100 |
commit | 29355270d36994b6a33d05bcc1f9a142818a325e (patch) | |
tree | 5b954dab34f288a477cedbb86beff775b980cbb0 /src/core/common | |
parent | 3a86b9dbe2c98c32f08942b07354a0361e8bafdb (diff) |
Added new version of Typesystem in cooperation with Andreas.
Diffstat (limited to 'src/core/common')
-rw-r--r-- | src/core/common/Variant.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/common/Variant.hpp b/src/core/common/Variant.hpp index d411fd3..c57ef57 100644 --- a/src/core/common/Variant.hpp +++ b/src/core/common/Variant.hpp @@ -434,6 +434,24 @@ public: bool isMap() const { return type == Type::MAP; } /** + * Checks whether this Variant instance is a primitive type. + * + * @return true if the Variant instance is a primitive type. + */ + bool isPrimitive() const { + switch(type){ + case Type::NULLPTR: + case Type::BOOL: + case Type::INT: + case Type::DOUBLE: + case Type::STRING: + return true; + default: + return false; + } + } + + /** * Returns the Variant boolean value. Performs no type conversion. Throws an * exception if the underlying type is not a boolean. * |