source: XIOS3/trunk/src/attribute_map.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.7 KB
RevLine 
[591]1#ifndef __XIOS_CAttributeMap__
2#define __XIOS_CAttributeMap__
[219]3
[591]4/// XIOS headers ///
5#include "xios_spl.hpp"
[219]6#include "attribute.hpp"
7#include "attribute_template.hpp"
8#include "exception.hpp"
9#include "xml_node.hpp"
10
[335]11namespace xios
[219]12{
13      /// ////////////////////// Déclarations ////////////////////// ///
[1158]14      /*!
15        \class CAttributeMap
16        This class represents the set of attributes which an object can have.
17        Each attribute in the set is represented by an unique id.
18      */
19
[219]20      class CAttributeMap
21         : public xios_map<StdString, CAttribute*>
22      {
23            typedef xios_map<StdString, CAttribute*> SuperClassMap;
24
25         public :
26
27            /// Tests ///
[1009]28            bool hasAttribute(const StdString & key) const;
[219]29
30            /// Accesseurs ///
31            CAttribute * operator[](const StdString & key);
32
33            /// Mutateurs ///
34            void setAttribute(const StdString & key, CAttribute * const attr);
35
36            void setAttributes(const xml::THashAttributes & attributes);
[445]37            void setAttributes(const CAttributeMap * const _parent, bool apply=true);
[623]38            void duplicateAttributes(const CAttributeMap* const _parent);
[2388]39            size_t computeGlobalAttributesHash(const vector<StdString>& excludedAttrs);
[219]40            void clearAllAttributes(void);
[1622]41            StdString dumpXiosAttributes(void) const;
[2146]42            StdString recordXiosAttributes(void) const;
[219]43
[509]44            void clearAttribute(const StdString& key);
[1158]45            bool isEqual(const CAttributeMap& another, const vector<StdString>& excludedAttrs);
[509]46
[219]47            /// Destructeur ///
48            virtual ~CAttributeMap(void);
49
50            /// Flux ///
51            // Debug only //
52            // friend StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap);
53
54            /// Autre ///
55            virtual StdString toString(void) const;
56            virtual void fromString(const StdString & str);
[509]57
[369]58//            virtual void toBinary  (StdOStream & os) const;
59//            virtual void fromBinary(StdIStream & is);
[313]60            virtual void generateCInterface(ostream& oss, const string& className) ;
61            virtual void generateFortran2003Interface(ostream& oss, const string& className) ;
62            virtual void generateFortranInterface_hdl_(ostream& oss, const string& className) ;
63            virtual void generateFortranInterface_hdl(ostream& oss, const string& className) ;
64            virtual void generateFortranInterface_id(ostream& oss, const string& className) ;
65            virtual void generateFortranInterfaceGet_hdl_(ostream& oss, const string& className) ;
66            virtual void generateFortranInterfaceGet_hdl(ostream& oss, const string& className) ;
67            virtual void generateFortranInterfaceGet_id(ostream& oss, const string& className) ;
[432]68            virtual void generateFortranInterfaceIsDefined_hdl_(ostream& oss, const string& className) ;
69            virtual void generateFortranInterfaceIsDefined_hdl(ostream& oss, const string& className) ;
70            virtual void generateFortranInterfaceIsDefined_id(ostream& oss, const string& className) ;
[219]71
72         protected :
73
74            /// Constructeurs ///
75            CAttributeMap(void);
76            CAttributeMap(const xios_map<StdString, CAttribute*> & umap);       // Never implemented.
77            CAttributeMap(const xios_map<StdString, CAttribute*> * const umap); // Not implemented.
78
79            /// Propriété statique ///
80            static CAttributeMap * Current;
81
82      };  // class CAttributeMap
83
[1009]84      inline bool CAttributeMap::hasAttribute(const StdString& key) const
85      {
[1158]86         return (this->find(key) != this->end());
[1009]87      }
88
[335]89} // namespace xios
[219]90
[591]91#endif // __XIOS_CAttributeMap__
Note: See TracBrowser for help on using the repository browser.