diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-04-12 02:50:18 +0200 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2016-04-25 22:24:15 +0200 |
commit | c7cb92f43f97ef5558eee0d7be6f18192134f3ec (patch) | |
tree | 6475300d3f1ad862a7d4e4514084770e33ce2775 /src/core/model/Ontology.hpp | |
parent | c917381e5eb5700326d2389ffe0874565fc970ac (diff) |
Replace NodeVector by ManagedVector where NodeVector functionality is not needed. Reduces calls to "Manager.registerEvent" to <10% of original value
Diffstat (limited to 'src/core/model/Ontology.hpp')
-rw-r--r-- | src/core/model/Ontology.hpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/model/Ontology.hpp b/src/core/model/Ontology.hpp index 3ef3b65..2533b9d 100644 --- a/src/core/model/Ontology.hpp +++ b/src/core/model/Ontology.hpp @@ -300,7 +300,7 @@ public: * the Structure Tree of instances of this field including subclasses of * children, which are allowed directly. */ - NodeVector<StructuredClass> getChildrenWithSubclasses() const; + ManagedVector<StructuredClass> getChildrenWithSubclasses() const; /** * Adds a StructuredClass whose instances shall be allowed as children in @@ -449,7 +449,7 @@ public: * @return a vector of all TREE fields that are allowed as structure tree * children of an instance of this Descriptor. */ - NodeVector<FieldDescriptor> getDefaultFields() const; + ManagedVector<FieldDescriptor> getDefaultFields() const; /** * Returns the name of this FieldDescriptor or the default field name @@ -643,9 +643,10 @@ public: * * @return the NodeVector of all FieldDescriptors of this Descriptor. */ - virtual NodeVector<FieldDescriptor> getFieldDescriptors() const + virtual ManagedVector<FieldDescriptor> getFieldDescriptors() const { - return fieldDescriptors; + return ManagedVector<FieldDescriptor>(const_cast<Descriptor*>(this), fieldDescriptors.begin(), + fieldDescriptors.end()); } /** @@ -856,7 +857,7 @@ public: * @return a vector of all TREE fields that are allowed as structure tree * children of an instance of this Descriptor. */ - NodeVector<FieldDescriptor> getDefaultFields() const; + ManagedVector<FieldDescriptor> getDefaultFields() const; /** * Returns a vector of all StructuredClasses that are allowed as children @@ -1035,7 +1036,7 @@ private: * Helper method for getFieldDescriptors. */ Rooted<FieldDescriptor> gatherFieldDescriptors( - NodeVector<FieldDescriptor> ¤t, + ManagedVector<FieldDescriptor> ¤t, std::unordered_set<const StructuredClass *> &visited, std::set<std::string> &overriddenFields, bool hasTREE) const; @@ -1170,7 +1171,7 @@ public: * * @return a NodeVector of all FieldDescriptors of this StructuredClass. */ - NodeVector<FieldDescriptor> getFieldDescriptors() const override; + ManagedVector<FieldDescriptor> getFieldDescriptors() const override; bool isTransparent() const { return transparent; } @@ -1483,4 +1484,4 @@ extern const Rtti Ontology; } } -#endif /* _OUSIA_MODEL_ONTOLOGY_HPP_ */
\ No newline at end of file +#endif /* _OUSIA_MODEL_ONTOLOGY_HPP_ */ |