1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_AttributeRefList.h
5 // Author: Mikhail PONIKAROV
7 #ifndef ModelAPI_AttributeRefList_H_
8 #define ModelAPI_AttributeRefList_H_
10 #include "ModelAPI_Attribute.h"
11 #include "ModelAPI_Feature.h"
14 /**\class ModelAPI_AttributeRefList
16 * \brief Attribute that contains list of references to features (located in the same document).
19 class ModelAPI_AttributeRefList : public ModelAPI_Attribute
22 /// Returns the type of this class of attributes
23 MODELAPI_EXPORT static std::string typeId()
28 /// Returns the type of this class of attributes, not static method
29 MODELAPI_EXPORT virtual std::string attributeType();
31 /// Appends the feature to the end of a list
32 MODELAPI_EXPORT virtual void append(ObjectPtr theObject) = 0;
34 /// Erases the first meet of the feature in the list
35 MODELAPI_EXPORT virtual void remove(ObjectPtr theObject) = 0;
37 /// Returns number of features in the list
38 MODELAPI_EXPORT virtual int size() const = 0;
40 /// Returns the list of features
41 MODELAPI_EXPORT virtual std::list<ObjectPtr> list() = 0;
43 /// Returns the referenced object by the zero-based index
44 MODELAPI_EXPORT virtual ObjectPtr object(const int theIndex) const = 0;
46 MODELAPI_EXPORT virtual ~ModelAPI_AttributeRefList();
48 /// Objects are created for features automatically
49 MODELAPI_EXPORT ModelAPI_AttributeRefList();
53 typedef std::shared_ptr<ModelAPI_AttributeRefList> AttributeRefListPtr;