Salome HOME
Separate definition from declaration for each ModelAPI class
[modules/shaper.git] / src / ModelAPI / ModelAPI_Attribute.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_Attribute.cpp
4 // Created:     2 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #include <ModelAPI_Attribute.h>
8
9 ModelAPI_Attribute::~ModelAPI_Attribute()
10 {
11 }
12
13   /// Sets the owner of this attribute
14 void ModelAPI_Attribute::setObject(const std::shared_ptr<ModelAPI_Object>& theObject)
15 {
16   myObject = theObject;
17 }
18
19   /// Returns the owner of this attribute
20 const std::shared_ptr<ModelAPI_Object>& ModelAPI_Attribute::owner() const
21 {
22   return myObject;
23 }
24
25   /// Returns true if attribute was  initialized by some value
26 bool ModelAPI_Attribute::isInitialized()
27 {
28   return myIsInitialized;
29 }
30
31 void ModelAPI_Attribute::setInitialized()
32 {
33   myIsInitialized = true;
34 }
35
36 void ModelAPI_Attribute::setIsArgument(const bool theFlag)
37 {
38   myIsArgument = theFlag;
39 }
40
41 bool ModelAPI_Attribute::isArgument()
42 {
43   return myIsArgument;
44 }
45
46 bool ModelAPI_Attribute::setImmutable(const bool theFlag)
47 {
48   bool aResult = myIsImmutable;
49   myIsImmutable = theFlag;
50   return aResult;
51 }
52
53 bool ModelAPI_Attribute::isImmutable()
54 {
55   return myIsImmutable;
56 }
57
58 const std::string& ModelAPI_Attribute::id() const
59 {
60   return myID;
61 }
62
63 ModelAPI_Attribute::ModelAPI_Attribute()
64 {
65   myIsInitialized = false;
66   myIsArgument = true;
67   myIsImmutable = false;
68 }
69
70   /// Sets the ID of the attribute in Data (called from Data)
71 void ModelAPI_Attribute::setID(const std::string theID)
72 {
73   myID = theID;
74 }