Salome HOME
Replace boost::shared_ptr<ModelAPI_Feature> on FeaturePtr
[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 "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(FeaturePtr theFeature);
25
26   /// Erases the first meet of the feature in the list
27   MODEL_EXPORT virtual void remove(FeaturePtr theFeature);
28
29   /// Returns number of features in the list
30   MODEL_EXPORT virtual int size();
31
32   /// Returns the list of features
33   MODEL_EXPORT virtual std::list<FeaturePtr > list();
34
35 protected:
36   /// Objects are created for features automatically
37   MODEL_EXPORT Model_AttributeRefList(TDF_Label& theLabel);
38
39   friend class Model_Data;
40 };
41
42 #endif