[369] | 1 | #ifndef __XIOS_ATTRIBUTE_ARRAY__ |
---|
| 2 | #define __XIOS_ATTRIBUTE_ARRAY__ |
---|
| 3 | |
---|
[591] | 4 | /// XIOS headers /// |
---|
| 5 | #include "xios_spl.hpp" |
---|
[369] | 6 | #include "exception.hpp" |
---|
| 7 | #include "attribute.hpp" |
---|
| 8 | #include "buffer_in.hpp" |
---|
| 9 | #include "buffer_out.hpp" |
---|
| 10 | #include "array_new.hpp" |
---|
| 11 | |
---|
| 12 | namespace xios |
---|
| 13 | { |
---|
| 14 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 15 | template <typename T_numtype, int N_rank> |
---|
[778] | 16 | class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank> |
---|
[369] | 17 | { |
---|
| 18 | public : |
---|
| 19 | |
---|
| 20 | using CArray<T_numtype,N_rank>::operator = ; |
---|
[392] | 21 | // using Array<T_numtype,N_rank>::operator = ; |
---|
[775] | 22 | |
---|
[369] | 23 | /// Constructeurs /// |
---|
| 24 | explicit CAttributeArray(const StdString & id); |
---|
| 25 | CAttributeArray(const StdString & id, xios_map<StdString, CAttribute*> & umap); |
---|
| 26 | CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value); |
---|
[775] | 27 | CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value, |
---|
[369] | 28 | xios_map<StdString, CAttribute*> & umap); |
---|
| 29 | |
---|
| 30 | /// Accesseur /// |
---|
| 31 | CArray<T_numtype, N_rank> getValue(void) const; |
---|
| 32 | |
---|
| 33 | /// Mutateurs /// |
---|
| 34 | void setValue(const CArray<T_numtype, N_rank>& value); |
---|
| 35 | void set(const CAttribute& attr) ; |
---|
| 36 | void set(const CAttributeArray& attr) ; |
---|
[775] | 37 | void reset(void) ; |
---|
[445] | 38 | void setInheritedValue(const CAttributeArray& attr ); |
---|
| 39 | void setInheritedValue(const CAttribute& attr ); |
---|
| 40 | CArray<T_numtype, N_rank> getInheritedValue(void) const ; |
---|
[775] | 41 | bool hasInheritedValue(void) const; |
---|
[445] | 42 | |
---|
[369] | 43 | /// Destructeur /// |
---|
| 44 | virtual ~CAttributeArray(void) { } |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | /// Autre /// |
---|
| 48 | virtual string toString(void) const { return _toString();} |
---|
| 49 | virtual void fromString(const StdString & str) { _fromString(str);} |
---|
[775] | 50 | virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} |
---|
| 51 | virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } |
---|
| 52 | |
---|
[369] | 53 | virtual void generateCInterface(ostream& oss,const string& className) ; |
---|
| 54 | virtual void generateFortran2003Interface(ostream& oss,const string& className) ; |
---|
| 55 | virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) ; |
---|
| 56 | virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) ; |
---|
| 57 | virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) ; |
---|
| 58 | virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) ; |
---|
| 59 | virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ; |
---|
| 60 | virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; |
---|
| 61 | |
---|
[775] | 62 | |
---|
[369] | 63 | protected : |
---|
| 64 | |
---|
| 65 | /// Constructeurs /// |
---|
| 66 | |
---|
| 67 | private : |
---|
[445] | 68 | CArray<T_numtype, N_rank> inheritedValue ; |
---|
[369] | 69 | StdString _toString(void) const; |
---|
| 70 | void _fromString(const StdString & str); |
---|
| 71 | bool _toBuffer (CBufferOut& buffer) const; |
---|
| 72 | bool _fromBuffer(CBufferIn& buffer) ; |
---|
[775] | 73 | }; // class CAttributeEnum |
---|
[369] | 74 | } // namespace xios |
---|
| 75 | |
---|
| 76 | #endif // __XIOS_ATTRIBUTE_ARRAY__ |
---|