Salome HOME
Define guards are corrected according to the code style
[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_H_
6 #define ModelAPI_AttributeRefList_H_
7
8 #include "ModelAPI_Attribute.h"
9 #include "ModelAPI_Feature.h"
10 #include <list>
11
12 /**\class ModelAPI_AttributeRefList
13  * \ingroup DataModel
14  * \brief Attribute that contains list of references to features (located in the same document).
15  */
16
17 class ModelAPI_AttributeRefList : public ModelAPI_Attribute
18 {
19 public:
20   /// Returns the type of this class of attributes
21   MODELAPI_EXPORT static std::string type() {return "RefList";}
22
23   /// Returns the type of this class of attributes, not static method
24   MODELAPI_EXPORT virtual std::string attributeType() {return type();}
25
26   /// Appends the feature to the end of a list
27   MODELAPI_EXPORT virtual void append(ObjectPtr theObject) = 0;
28
29   /// Erases the first meet of the feature in the list
30   MODELAPI_EXPORT virtual void remove(ObjectPtr theObject) = 0;
31
32   /// Returns number of features in the list
33   MODELAPI_EXPORT virtual int size() = 0;
34
35   /// Returns the list of features
36   MODELAPI_EXPORT virtual std::list<ObjectPtr> list() = 0;
37
38 protected:
39   /// Objects are created for features automatically
40   MODELAPI_EXPORT ModelAPI_AttributeRefList()
41   {}
42 };
43
44 #endif