diff options
Diffstat (limited to 'src/core')
-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. |