[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 | |
---|
[345] | 56 | CMessage& operator<<(CMessage& msg,CAttribute& type) |
---|
[300] | 57 | { |
---|
| 58 | msg.push(type) ; |
---|
| 59 | return msg ; |
---|
| 60 | } |
---|
| 61 | |
---|
[680] | 62 | CMessage& operator<<(CMessage& msg, const CAttribute& type) |
---|
[300] | 63 | { |
---|
[369] | 64 | // msg.push(*type.clone()) ; |
---|
[300] | 65 | return msg ; |
---|
| 66 | } |
---|
| 67 | |
---|
[680] | 68 | CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type) |
---|
[300] | 69 | { |
---|
| 70 | |
---|
[680] | 71 | if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type)", |
---|
| 72 | << "Not enough free space in buffer to queue the attribute."); |
---|
[300] | 73 | return buffer ; |
---|
| 74 | } |
---|
| 75 | |
---|
[680] | 76 | CBufferIn& operator>>(CBufferIn& buffer, CAttribute& type) |
---|
[300] | 77 | { |
---|
| 78 | |
---|
[680] | 79 | if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, CAttribute& type)", |
---|
| 80 | << "Not enough data in buffer to unqueue the attribute."); |
---|
[300] | 81 | return buffer ; |
---|
| 82 | } |
---|
| 83 | |
---|
[432] | 84 | |
---|
[335] | 85 | } // namespace xios |
---|