[219] | 1 | #include "attribute.hpp" |
---|
[300] | 2 | #include "base_type.hpp" |
---|
[432] | 3 | #include "generate_interface.hpp" |
---|
[219] | 4 | |
---|
[432] | 5 | |
---|
[335] | 6 | namespace xios |
---|
[219] | 7 | { |
---|
[1112] | 8 | |
---|
| 9 | const StdString CAttribute::resetInheritanceStr("_reset_") ; |
---|
| 10 | |
---|
[219] | 11 | /// ////////////////////// Définitions ////////////////////// /// |
---|
| 12 | CAttribute::CAttribute(const StdString & id) |
---|
[1112] | 13 | : CObject(id), CBaseType(), _canInherite(true) |
---|
[369] | 14 | // , value() |
---|
[219] | 15 | { /* Ne rien faire de plus */ } |
---|
[369] | 16 | /* |
---|
| 17 | */ |
---|
[219] | 18 | CAttribute::~CAttribute(void) |
---|
| 19 | { /* Ne rien faire de plus */ } |
---|
| 20 | |
---|
| 21 | ///-------------------------------------------------------------- |
---|
| 22 | |
---|
| 23 | const StdString & CAttribute::getName(void) const |
---|
| 24 | { |
---|
| 25 | return (this->getId()); |
---|
| 26 | } |
---|
[432] | 27 | |
---|
| 28 | void CAttribute::generateCInterfaceIsDefined(ostream& oss, const string& className) |
---|
| 29 | { |
---|
| 30 | CInterface::AttributeIsDefinedCInterface(oss, className, this->getName()) ; |
---|
| 31 | } |
---|
[219] | 32 | |
---|
[432] | 33 | void CAttribute::generateFortran2003InterfaceIsDefined(ostream& oss, const string& className) |
---|
| 34 | { |
---|
| 35 | CInterface::AttributeIsDefinedFortran2003Interface(oss, className, this->getName()) ; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | void CAttribute::generateFortranInterfaceIsDefinedDeclaration_(ostream& oss,const string& className) |
---|
| 40 | { |
---|
| 41 | CInterface::AttributeFortranInterfaceIsDefinedDeclaration(oss, className, this->getName()+"_") ; |
---|
| 42 | } |
---|
[300] | 43 | |
---|
[432] | 44 | void CAttribute::generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className) |
---|
| 45 | { |
---|
| 46 | CInterface::AttributeFortranInterfaceIsDefinedDeclaration(oss, className, this->getName()) ; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | void CAttribute::generateFortranInterfaceIsDefinedBody_(ostream& oss,const string& className) |
---|
| 50 | { |
---|
| 51 | CInterface::AttributeFortranInterfaceIsDefinedBody(oss, className, this->getName()) ; |
---|
| 52 | } |
---|
| 53 | |
---|
[219] | 54 | ///-------------------------------------------------------------- |
---|
| 55 | |
---|
[1134] | 56 | |
---|
[345] | 57 | CMessage& operator<<(CMessage& msg,CAttribute& type) |
---|
[300] | 58 | { |
---|
| 59 | msg.push(type) ; |
---|
| 60 | return msg ; |
---|
| 61 | } |
---|
| 62 | |
---|
[680] | 63 | CMessage& operator<<(CMessage& msg, const CAttribute& type) |
---|
[300] | 64 | { |
---|
[369] | 65 | // msg.push(*type.clone()) ; |
---|
[300] | 66 | return msg ; |
---|
| 67 | } |
---|
| 68 | |
---|
[680] | 69 | CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type) |
---|
[300] | 70 | { |
---|
| 71 | |
---|
[680] | 72 | if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type)", |
---|
| 73 | << "Not enough free space in buffer to queue the attribute."); |
---|
[300] | 74 | return buffer ; |
---|
| 75 | } |
---|
| 76 | |
---|
[680] | 77 | CBufferIn& operator>>(CBufferIn& buffer, CAttribute& type) |
---|
[300] | 78 | { |
---|
| 79 | |
---|
[680] | 80 | if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, CAttribute& type)", |
---|
| 81 | << "Not enough data in buffer to unqueue the attribute."); |
---|
[300] | 82 | return buffer ; |
---|
| 83 | } |
---|
| 84 | |
---|
[432] | 85 | |
---|
[335] | 86 | } // namespace xios |
---|