diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-04-09 16:02:21 +0200 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2016-04-25 22:19:35 +0200 |
commit | f236e4d7401d55d18707ac3374f913ada41e5b7b (patch) | |
tree | 7770f397b4ce2487ae19ed11143583f7d44e3af2 /src/core/model | |
parent | f98526eb42909efbc8b2b4f85dfbfd588e25f515 (diff) |
added serialization support for attributes descriptors.
Diffstat (limited to 'src/core/model')
-rw-r--r-- | src/core/model/Typesystem.cpp | 8 | ||||
-rw-r--r-- | src/core/model/Typesystem.hpp | 26 |
2 files changed, 25 insertions, 9 deletions
diff --git a/src/core/model/Typesystem.cpp b/src/core/model/Typesystem.cpp index df2b9fb..688cb60 100644 --- a/src/core/model/Typesystem.cpp +++ b/src/core/model/Typesystem.cpp @@ -618,6 +618,14 @@ bool StructType::cast(Variant &data, Logger &logger) const return buildFromArrayOrMap(data, logger, NullMagicCallback, true); } +NodeVector<Attribute> StructType::getOwnAttributes() const +{ + NodeVector<Attribute> res; + res.insert(res.end(), attributes.begin() + attributeStart, + attributes.end()); + return res; +} + ssize_t StructType::indexOf(const std::string &name) const { size_t res; diff --git a/src/core/model/Typesystem.hpp b/src/core/model/Typesystem.hpp index 559a74c..193726d 100644 --- a/src/core/model/Typesystem.hpp +++ b/src/core/model/Typesystem.hpp @@ -64,20 +64,20 @@ public: */ enum class MagicCallbackResult { /** - * A magic value with the given name could not be resolved. - */ + * A magic value with the given name could not be resolved. + */ NOT_FOUND, /** - * A magic value with the given name could be resolved, but is of the - * wrong type. - */ + * A magic value with the given name could be resolved, but is of the + * wrong type. + */ FOUND_INVALID, /** - * A magic value with the given name could be resolved and is of the - * correct type. - */ + * A magic value with the given name could be resolved and is of the + * correct type. + */ FOUND_VALID }; @@ -953,7 +953,15 @@ public: * * @return a const reference pointing at the attribute list. */ - const NodeVector<Attribute> &getAttributes() const { return attributes; }; + const NodeVector<Attribute> &getAttributes() const { return attributes; } + + /** + * Returns a vector of all attributes that belong to this StructType itself, + * excluding the attributes of the parent structure. + * + * @return a vector of all attributes that belong to this StructType itself. + */ + NodeVector<Attribute> getOwnAttributes() const; /** * Returns the index of the given attribute in a data array representing |