20 #ifndef ModelAPI_AttributeRefList_H_
21 #define ModelAPI_AttributeRefList_H_
23 #include "ModelAPI_Attribute.h"
24 #include "ModelAPI_Feature.h"
36 MODELAPI_EXPORT
static std::string
typeId()
45 virtual void append(ObjectPtr theObject) = 0;
48 virtual void remove(ObjectPtr theObject) = 0;
55 virtual int size(
const bool theWithEmpty =
true)
const = 0;
58 virtual std::list<ObjectPtr>
list() = 0;
61 virtual bool isInList(
const ObjectPtr& theObj) = 0;
66 virtual ObjectPtr
object(
const int theIndex,
const bool theWithEmpty =
true) = 0;
69 virtual void substitute(
const ObjectPtr& theCurrent,
const ObjectPtr& theNew) = 0;
76 virtual void remove(
const std::set<int>& theIndices) = 0;
85 typedef std::shared_ptr<ModelAPI_AttributeRefList> AttributeRefListPtr;
Attribute that contains list of references to features (located in the same document).
Definition: ModelAPI_AttributeRefList.h:33
virtual void remove(const std::set< int > &theIndices)=0
Removes the elements from the list.
virtual void append(ObjectPtr theObject)=0
Appends the feature to the end of a list.
virtual std::string attributeType()
Returns the type of this class of attributes, not static method.
Definition: ModelAPI_AttributeRefList.cpp:22
virtual void substitute(const ObjectPtr &theCurrent, const ObjectPtr &theNew)=0
Substitutes the object by another one. Does nothing if such object is not found.
virtual int size(const bool theWithEmpty=true) const =0
Returns number of features in the list.
virtual void remove(ObjectPtr theObject)=0
Erases the first meet of the feature in the list.
virtual void clear()=0
Removes all references from the list.
static std::string typeId()
Returns the type of this class of attributes.
Definition: ModelAPI_AttributeRefList.h:36
virtual ObjectPtr object(const int theIndex, const bool theWithEmpty=true)=0
Returns the referenced object by the zero-based index.
ModelAPI_AttributeRefList()
Objects are created for features automatically.
Definition: ModelAPI_AttributeRefList.cpp:32
virtual void removeLast()=0
Removes the last element in the list.
virtual bool isInList(const ObjectPtr &theObj)=0
Returns true if the object is in list.
virtual std::list< ObjectPtr > list()=0
Returns the list of features.
Generic attribute of the Object.
Definition: ModelAPI_Attribute.h:34