diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-04 21:25:28 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2015-03-04 21:25:28 +0100 |
commit | 35b9b903daee88dea0e5efd9c0622cf09f177534 (patch) | |
tree | e5dc368cc75a707c792121e257c428f0f4a4774e /src | |
parent | b5c0354bdb36dc665d8a437bb6e01bb093df6dc9 (diff) |
Added getFieldDescriptor method with numeric index
Diffstat (limited to 'src')
-rw-r--r-- | src/core/model/Ontology.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/model/Ontology.hpp b/src/core/model/Ontology.hpp index 079640c..8d6e596 100644 --- a/src/core/model/Ontology.hpp +++ b/src/core/model/Ontology.hpp @@ -669,6 +669,7 @@ public: * FieldDescriptor is not registered at this Descriptor. */ ssize_t getFieldDescriptorIndex(Handle<FieldDescriptor> fd) const; + /** * Returns the FieldDescriptor with the given name. * @@ -680,6 +681,23 @@ public: Rooted<FieldDescriptor> getFieldDescriptor( const std::string &name = DEFAULT_FIELD_NAME) const; + + /** + * Returns the FieldDescriptor with the given index. + * + * @param index the index of the field that should be retrieved. + + * @return the FieldDescriptor with the given index or a nullptr if no + * such FieldDescriptor was found. + */ + Rooted<FieldDescriptor> getFieldDescriptor(size_t index) const + { + if (index < fieldDescriptors.size()) { + return fieldDescriptors[index]; + } + return nullptr; + } + /** * This returns true if this Descriptor has a FieldDescriptor with the * given name. |