Salome HOME
Merge branch 'SketchSolver_Linux' of newgeom:newgeom into SolveSpace
[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_HeaderFile
6 #define Model_AttributeRefList_HeaderFile
7
8 #include "Model.h"
9 #include "ModelAPI_AttributeRefList.h"
10 #include <TDataStd_ReferenceList.hxx>
11
12 /**\class Model_AttributeRefList
13  * \ingroup DataModel
14  * \brief Attribute that contains list of references to features (located in the same document).
15  */
16
17 class Model_AttributeRefList : public ModelAPI_AttributeRefList
18 {
19   Handle_TDataStd_ReferenceList myRef; ///< references to the features labels
20 public:
21   /// Appends the feature to the end of a list
22   MODEL_EXPORT virtual void append(boost::shared_ptr<ModelAPI_Feature> theFeature);
23
24   /// Erases the first meet of the feature in the list
25   MODEL_EXPORT virtual void remove(boost::shared_ptr<ModelAPI_Feature> theFeature);
26
27   /// Returns number of features in the list
28   MODEL_EXPORT virtual int size();
29
30   /// Returns the list of features
31   MODEL_EXPORT virtual std::list<boost::shared_ptr<ModelAPI_Feature> > list();
32
33 protected:
34   /// Objects are created for features automatically
35   MODEL_EXPORT Model_AttributeRefList(TDF_Label& theLabel);
36
37   friend class Model_Data;
38 };
39
40 #endif