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 | */ |
---|
15 | CAttribute::~CAttribute(void) |
---|
16 | { /* Ne rien faire de plus */ } |
---|
17 | |
---|
18 | ///-------------------------------------------------------------- |
---|
19 | |
---|
20 | const StdString & CAttribute::getName(void) const |
---|
21 | { |
---|
22 | return (this->getId()); |
---|
23 | } |
---|
24 | |
---|
25 | void CAttribute::generateCInterfaceIsDefined(ostream& oss, const string& className) |
---|
26 | { |
---|
27 | CInterface::AttributeIsDefinedCInterface(oss, className, this->getName()) ; |
---|
28 | } |
---|
29 | |
---|
30 | void CAttribute::generateFortran2003InterfaceIsDefined(ostream& oss, const string& className) |
---|
31 | { |
---|
32 | CInterface::AttributeIsDefinedFortran2003Interface(oss, className, this->getName()) ; |
---|
33 | } |
---|
34 | |
---|
35 | |
---|
36 | void CAttribute::generateFortranInterfaceIsDefinedDeclaration_(ostream& oss,const string& className) |
---|
37 | { |
---|
38 | CInterface::AttributeFortranInterfaceIsDefinedDeclaration(oss, className, this->getName()+"_") ; |
---|
39 | } |
---|
40 | |
---|
41 | void CAttribute::generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className) |
---|
42 | { |
---|
43 | CInterface::AttributeFortranInterfaceIsDefinedDeclaration(oss, className, this->getName()) ; |
---|
44 | } |
---|
45 | |
---|
46 | void CAttribute::generateFortranInterfaceIsDefinedBody_(ostream& oss,const string& className) |
---|
47 | { |
---|
48 | CInterface::AttributeFortranInterfaceIsDefinedBody(oss, className, this->getName()) ; |
---|
49 | } |
---|
50 | |
---|
51 | ///-------------------------------------------------------------- |
---|
52 | |
---|
53 | CMessage& operator<<(CMessage& msg,CAttribute& type) |
---|
54 | { |
---|
55 | msg.push(type) ; |
---|
56 | return msg ; |
---|
57 | } |
---|
58 | |
---|
59 | CMessage& operator<<(CMessage& msg, const CAttribute& type) |
---|
60 | { |
---|
61 | // msg.push(*type.clone()) ; |
---|
62 | return msg ; |
---|
63 | } |
---|
64 | |
---|
65 | CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type) |
---|
66 | { |
---|
67 | |
---|
68 | if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type)", |
---|
69 | << "Not enough free space in buffer to queue the attribute."); |
---|
70 | return buffer ; |
---|
71 | } |
---|
72 | |
---|
73 | CBufferIn& operator>>(CBufferIn& buffer, CAttribute& type) |
---|
74 | { |
---|
75 | |
---|
76 | if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, CAttribute& type)", |
---|
77 | << "Not enough data in buffer to unqueue the attribute."); |
---|
78 | return buffer ; |
---|
79 | } |
---|
80 | |
---|
81 | |
---|
82 | } // namespace xios |
---|