Salome HOME
2b0edac1fc99c7a2f4ab30f1109f29e2c140b668
[modules/shaper.git] / src / Model / Model_AttributeRefList.h
1 // File:        Model_AttributeRefList.h
2 // Created:     8 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_AttributeRefList_H_
6 #define Model_AttributeRefList_H_
7
8 #include "Model.h"
9 #include "ModelAPI_AttributeRefList.h"
10 #include "ModelAPI_Feature.h"
11
12 #include <TDataStd_ReferenceList.hxx>
13
14 /**\class Model_AttributeRefList
15  * \ingroup DataModel
16  * \brief Attribute that contains list of references to features (located in the same document).
17  */
18
19 class Model_AttributeRefList : public ModelAPI_AttributeRefList
20 {
21   Handle_TDataStd_ReferenceList myRef;  ///< references to the features labels
22  public:
23   /// Appends the feature to the end of a list
24   MODEL_EXPORT virtual void append(ObjectPtr theObject);
25
26   /// Erases the first meet of the feature in the list
27   MODEL_EXPORT virtual void remove(ObjectPtr theObject);
28
29   /// Returns number of features in the list
30   MODEL_EXPORT virtual int size() const;
31
32   /// Returns the list of features
33   MODEL_EXPORT virtual std::list<ObjectPtr> list();
34
35   /// Returns the list of features
36   MODEL_EXPORT virtual ObjectPtr object(const int theIndex) const;
37
38  protected:
39   /// Objects are created for features automatically
40   MODEL_EXPORT Model_AttributeRefList(TDF_Label& theLabel);
41
42   friend class Model_Data;
43 };
44
45 #endif