20 #ifndef ModelAPI_AttributeRefAttrList_H_
21 #define ModelAPI_AttributeRefAttrList_H_
23 #include "ModelAPI_Attribute.h"
24 #include "ModelAPI_Feature.h"
37 MODELAPI_EXPORT
static std::string
typeId()
46 virtual void append(ObjectPtr theObject) = 0;
48 virtual void append(AttributePtr theAttr) = 0;
51 virtual void remove(ObjectPtr theObject) = 0;
53 virtual void remove(AttributePtr theAttr) = 0;
59 virtual int size()
const = 0;
62 virtual std::list<std::pair<ObjectPtr, AttributePtr> >
list() = 0;
65 virtual bool isInList(
const ObjectPtr& theObj) = 0;
67 virtual bool isInList(
const AttributePtr& theObj) = 0;
74 virtual ObjectPtr
object(
const int theIndex)
const = 0;
77 virtual AttributePtr
attribute(
const int theIndex)
const = 0;
84 virtual void remove(
const std::set<int>& theIndices) = 0;
93 typedef std::shared_ptr<ModelAPI_AttributeRefAttrList> AttributeRefAttrListPtr;
Attribute that contains list of references to features (located in the same document) or references t...
Definition: ModelAPI_AttributeRefAttrList.h:34
virtual void append(AttributePtr theAttr)=0
Appends the attribute to the end of a list.
virtual void remove(ObjectPtr theObject)=0
Erases the first meet of the feature in the list.
virtual bool isAttribute(const int theIndex) const =0
Returns true if this is reference to an attribute, not just object.
virtual void remove(AttributePtr theAttr)=0
Erases the first meet of the attribute in the list.
virtual int size() const =0
Returns number of features in the list.
virtual std::string attributeType()
Returns the type of this class of attributes, not static method.
Definition: ModelAPI_AttributeRefAttrList.cpp:22
virtual void remove(const std::set< int > &theIndices)=0
Removes the elements from the list.
static std::string typeId()
Returns the type of this class of attributes.
Definition: ModelAPI_AttributeRefAttrList.h:37
virtual void clear()=0
Removes all references from the list.
virtual void removeLast()=0
Removes the last element in the list.
virtual void append(ObjectPtr theObject)=0
Appends the feature to the end of a list.
virtual AttributePtr attribute(const int theIndex) const =0
Returns the referenced attribute by the zero-based index.
virtual bool isInList(const ObjectPtr &theObj)=0
Returns true if the object is in list.
virtual bool isInList(const AttributePtr &theObj)=0
Returns true if the attribute is in list.
ModelAPI_AttributeRefAttrList()
Objects are created for features automatically.
Definition: ModelAPI_AttributeRefAttrList.cpp:32
virtual ObjectPtr object(const int theIndex) const =0
Returns the referenced object by the zero-based index.
virtual std::list< std::pair< ObjectPtr, AttributePtr > > list()=0
Returns the list of features and attributes (if it is reference to the attribute)
Generic attribute of the Object.
Definition: ModelAPI_Attribute.h:34