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