diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-23 15:47:59 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-23 15:47:59 +0100 |
commit | 18d3637ca02ab69f1ee744fa94c43c243de0f571 (patch) | |
tree | 42c859f014ab7dbb7d31a747e0ef3839c77c60fa /src/core/common/Rtti.hpp | |
parent | 85d72823ef18711fe7a29f5b23cc37b318766332 (diff) | |
parent | aa817d3bfd90aa39b6fd8a915bc78a8bb210cd3d (diff) |
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'src/core/common/Rtti.hpp')
-rw-r--r-- | src/core/common/Rtti.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/common/Rtti.hpp b/src/core/common/Rtti.hpp index 8350cb5..05cc728 100644 --- a/src/core/common/Rtti.hpp +++ b/src/core/common/Rtti.hpp @@ -378,10 +378,31 @@ public: * * @param other is the other type for which the relation to this type * should be checked. + * @return true if this type (directly or indirectly) has the given other + * type as parent or equals the other type. */ bool isa(const Rtti &other) const; /** + * Returns true if this Rtti instance is one of the given types. + * + * @param others is a set of other types to be checked. + * @return true if this type (directly or indirectly) has once of the given + * other types as parent or equals one of the other types. + */ + bool isOneOf(const RttiSet &others) const; + + /** + * Checks whether any type in the first set is one type in the second set. + * + * @param s1 is the first set. For each type in this set we check whether + * it is one of the types in s2. + * @param s2 is the second set. + * @return true if the above condition is fulfilled, false otherwise. + */ + static bool setIsOneOf(const RttiSet &s1, const RttiSet &s2); + + /** * Returns true if an instance of this type may have references to the other * given type. This mechanism is used to prune impossible paths when * resolving objects of a certain type by name in an object graph. |