source: XIOS3/trunk/src/attribute_array.hpp @ 2433

Last change on this file since 2433 was 2388, checked in by jderouillat, 23 months ago

Manage hash values with size_t in hash tables of elements associated to output files

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 3.6 KB
RevLine 
[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
12namespace xios
13{
14      /// ////////////////////// Déclarations ////////////////////// ///
[1158]15      /*!
16        \class CAttributeArray
17        This class implements the attribute representing array of value
18      */
[369]19      template <typename T_numtype, int N_rank>
[778]20         class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank>
[369]21      {
22        public :
[1875]23            using CArray<T_numtype,N_rank>::operator = ;
[369]24
25            /// Constructeurs ///
26            explicit CAttributeArray(const StdString & id);
27            CAttributeArray(const StdString & id, xios_map<StdString, CAttribute*> & umap);
28            CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value);
[775]29            CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value,
[369]30                           xios_map<StdString, CAttribute*> & umap);
31
32            /// Accesseur ///
33            CArray<T_numtype, N_rank> getValue(void) const;
34
35            /// Mutateurs ///
36            void setValue(const CArray<T_numtype, N_rank>& value);
37            void set(const CAttribute& attr) ;
38            void set(const CAttributeArray& attr) ;
[775]39            void reset(void) ;
[445]40            void setInheritedValue(const CAttributeArray& attr );
41            void setInheritedValue(const CAttribute& attr );
42            CArray<T_numtype, N_rank> getInheritedValue(void) const ;
[775]43            bool hasInheritedValue(void) const;
[1219]44                       
[1158]45            bool isEqual(const CAttribute& attr);
[2388]46            size_t computeHash(void);
[445]47
[369]48            /// Destructeur ///
49            virtual ~CAttributeArray(void) { }
50
51
52            /// Autre ///
53            virtual string toString(void) const { return _toString();}
[1158]54            virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;}  else _fromString(str);}
[775]55            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);}
56            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); }
[1622]57            virtual string dump(void) const { return _dump();}
[2146]58            virtual string dumpGraph(void) const { return _dumpGraph();}
[775]59
[369]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) ;
[1875]68 
[369]69         private :
[1219]70          bool isEqual_(const CAttributeArray& attr);
[445]71          CArray<T_numtype, N_rank> inheritedValue ;
[369]72          StdString _toString(void) const;
[1622]73          StdString _dump(void) const;
[2146]74          StdString _dumpGraph(void) const;
[369]75          void _fromString(const StdString & str);
76          bool _toBuffer  (CBufferOut& buffer) const;
77          bool _fromBuffer(CBufferIn& buffer) ;
[775]78      }; // class CAttributeEnum
[1875]79
80
[369]81} // namespace xios
82
83#endif // __XIOS_ATTRIBUTE_ARRAY__
Note: See TracBrowser for help on using the repository browser.