Salome HOME
Fixed the problem with several parts creation.
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeRefList.h
1 // File:        ModelAPI_AttributeRefList.h
2 // Created:     8 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_AttributeRefList_HeaderFile
6 #define ModelAPI_AttributeRefList_HeaderFile
7
8 #include "ModelAPI_Attribute.h"
9 #include <list>
10
11 /**\class ModelAPI_AttributeRefList
12  * \ingroup DataModel
13  * \brief Attribute that contains list of references to features (located in the same document).
14  */
15
16 class ModelAPI_AttributeRefList : public ModelAPI_Attribute
17 {
18 public:
19   /// Returns the type of this class of attributes
20   MODELAPI_EXPORT static std::string type() {return "RefList";}
21
22   /// Returns the type of this class of attributes, not static method
23   MODELAPI_EXPORT virtual std::string attributeType() {return type();}
24
25   /// Appends the feature to the end of a list
26   MODELAPI_EXPORT virtual void append(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
27
28   /// Erases the first meet of the feature in the list
29   MODELAPI_EXPORT virtual void remove(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
30
31   /// Returns number of features in the list
32   MODELAPI_EXPORT virtual int size() = 0;
33
34   /// Returns the list of features
35   MODELAPI_EXPORT virtual std::list<boost::shared_ptr<ModelAPI_Feature> > list() = 0;
36
37 protected:
38   /// Objects are created for features automatically
39   MODELAPI_EXPORT ModelAPI_AttributeRefList()
40   {}
41 };
42
43 #endif