1 | #ifndef __XIOS_ATTRIBUTE_ARRAY__ |
---|
2 | #define __XIOS_ATTRIBUTE_ARRAY__ |
---|
3 | |
---|
4 | /// XIOS headers /// |
---|
5 | #include "xios_spl.hpp" |
---|
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 | /*! |
---|
16 | \class CAttributeArray |
---|
17 | This class implements the attribute representing array of value |
---|
18 | */ |
---|
19 | template <typename T_numtype, int N_rank> |
---|
20 | class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank> |
---|
21 | { |
---|
22 | public : |
---|
23 | |
---|
24 | using CArray<T_numtype,N_rank>::operator = ; |
---|
25 | |
---|
26 | /// Constructeurs /// |
---|
27 | explicit CAttributeArray(const StdString & id); |
---|
28 | CAttributeArray(const StdString & id, xios_map<StdString, CAttribute*> & umap); |
---|
29 | CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value); |
---|
30 | CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value, |
---|
31 | xios_map<StdString, CAttribute*> & umap); |
---|
32 | |
---|
33 | /// Accesseur /// |
---|
34 | CArray<T_numtype, N_rank> getValue(void) const; |
---|
35 | |
---|
36 | /// Mutateurs /// |
---|
37 | void setValue(const CArray<T_numtype, N_rank>& value); |
---|
38 | void set(const CAttribute& attr) ; |
---|
39 | void set(const CAttributeArray& attr) ; |
---|
40 | void reset(void) ; |
---|
41 | void setInheritedValue(const CAttributeArray& attr ); |
---|
42 | void setInheritedValue(const CAttribute& attr ); |
---|
43 | CArray<T_numtype, N_rank> getInheritedValue(void) const ; |
---|
44 | bool hasInheritedValue(void) const; |
---|
45 | |
---|
46 | bool isEqual(const CAttribute& attr); |
---|
47 | |
---|
48 | /// Destructeur /// |
---|
49 | virtual ~CAttributeArray(void) { } |
---|
50 | |
---|
51 | |
---|
52 | /// Autre /// |
---|
53 | virtual string toString(void) const { return _toString();} |
---|
54 | virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} |
---|
55 | virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} |
---|
56 | virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } |
---|
57 | virtual string dump(void) const { return _dump();} |
---|
58 | virtual string dump4graph(void) const { return _dump4graph();} |
---|
59 | |
---|
60 | virtual void generateCInterface(ostream& oss,const string& className) ; |
---|
61 | virtual void generateFortran2003Interface(ostream& oss,const string& className) ; |
---|
62 | virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) ; |
---|
63 | virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) ; |
---|
64 | virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) ; |
---|
65 | virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) ; |
---|
66 | virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ; |
---|
67 | virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; |
---|
68 | |
---|
69 | private : |
---|
70 | bool isEqual_(const CAttributeArray& attr); |
---|
71 | CArray<T_numtype, N_rank> inheritedValue ; |
---|
72 | StdString _toString(void) const; |
---|
73 | StdString _dump(void) const; |
---|
74 | StdString _dump4graph(void) const; |
---|
75 | void _fromString(const StdString & str); |
---|
76 | bool _toBuffer (CBufferOut& buffer) const; |
---|
77 | bool _fromBuffer(CBufferIn& buffer) ; |
---|
78 | }; // class CAttributeEnum |
---|
79 | } // namespace xios |
---|
80 | |
---|
81 | #endif // __XIOS_ATTRIBUTE_ARRAY__ |
---|