1 | #include "attribute.hpp" |
---|
2 | #include "base_type.hpp" |
---|
3 | #include "generate_interface.hpp" |
---|
4 | |
---|
5 | |
---|
6 | namespace xios |
---|
7 | { |
---|
8 | /// ////////////////////// Définitions ////////////////////// /// |
---|
9 | CAttribute::CAttribute(const StdString & id) |
---|
10 | : CObject(id), CBaseType() |
---|
11 | // , value() |
---|
12 | { /* Ne rien faire de plus */ } |
---|
13 | /* |
---|
14 | CAttribute::CAttribute(const CAttribute & attribut) |
---|
15 | : CObject(attribut.getId()),CBaseType() |
---|
16 | { |
---|
17 | // this->value = attribut.getAnyValue(); |
---|
18 | } |
---|
19 | */ |
---|
20 | CAttribute::~CAttribute(void) |
---|
21 | { /* Ne rien faire de plus */ } |
---|
22 | |
---|
23 | ///-------------------------------------------------------------- |
---|
24 | /* |
---|
25 | const boost::any & CAttribute::getAnyValue(void) const |
---|
26 | { |
---|
27 | return (this->value); |
---|
28 | } |
---|
29 | |
---|
30 | |
---|
31 | void CAttribute::setAnyValue(const boost::any & value) |
---|
32 | { |
---|
33 | this->value = value; |
---|
34 | } |
---|
35 | |
---|
36 | void CAttribute::clear(void) |
---|
37 | { |
---|
38 | this->value = boost::any(); |
---|
39 | } |
---|
40 | |
---|
41 | //--------------------------------------------------------------- |
---|
42 | |
---|
43 | bool CAttribute::isEmpty(void) const |
---|
44 | { |
---|
45 | return (this->value.empty()); |
---|
46 | } |
---|
47 | */ |
---|
48 | const StdString & CAttribute::getName(void) const |
---|
49 | { |
---|
50 | return (this->getId()); |
---|
51 | } |
---|
52 | |
---|
53 | void CAttribute::generateCInterfaceIsDefined(ostream& oss, const string& className) |
---|
54 | { |
---|
55 | CInterface::AttributeIsDefinedCInterface(oss, className, this->getName()) ; |
---|
56 | } |
---|
57 | |
---|
58 | void CAttribute::generateFortran2003InterfaceIsDefined(ostream& oss, const string& className) |
---|
59 | { |
---|
60 | CInterface::AttributeIsDefinedFortran2003Interface(oss, className, this->getName()) ; |
---|
61 | } |
---|
62 | |
---|
63 | |
---|
64 | void CAttribute::generateFortranInterfaceIsDefinedDeclaration_(ostream& oss,const string& className) |
---|
65 | { |
---|
66 | CInterface::AttributeFortranInterfaceIsDefinedDeclaration(oss, className, this->getName()+"_") ; |
---|
67 | } |
---|
68 | |
---|
69 | void CAttribute::generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className) |
---|
70 | { |
---|
71 | CInterface::AttributeFortranInterfaceIsDefinedDeclaration(oss, className, this->getName()) ; |
---|
72 | } |
---|
73 | |
---|
74 | void CAttribute::generateFortranInterfaceIsDefinedBody_(ostream& oss,const string& className) |
---|
75 | { |
---|
76 | CInterface::AttributeFortranInterfaceIsDefinedBody(oss, className, this->getName()) ; |
---|
77 | } |
---|
78 | |
---|
79 | ///-------------------------------------------------------------- |
---|
80 | |
---|
81 | |
---|
82 | CMessage& operator<<(CMessage& msg,CAttribute& type) |
---|
83 | { |
---|
84 | msg.push(type) ; |
---|
85 | return msg ; |
---|
86 | } |
---|
87 | |
---|
88 | CMessage& operator<<(CMessage& msg, const CAttribute& type) |
---|
89 | { |
---|
90 | // msg.push(*type.clone()) ; |
---|
91 | return msg ; |
---|
92 | } |
---|
93 | |
---|
94 | CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type) |
---|
95 | { |
---|
96 | |
---|
97 | if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type)", |
---|
98 | <<"Buffer remain size is to low for size type") ; |
---|
99 | return buffer ; |
---|
100 | } |
---|
101 | |
---|
102 | CBufferIn& operator>>(CBufferIn& buffer, CAttribute& type) |
---|
103 | { |
---|
104 | |
---|
105 | if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, CAttribute& type)", |
---|
106 | <<"Buffer remain size is to low for size type") ; |
---|
107 | return buffer ; |
---|
108 | } |
---|
109 | |
---|
110 | |
---|
111 | } // namespace xios |
---|