source: XIOS/dev/dev_olga/src/attribute.hpp @ 1612

Last change on this file since 1612 was 1612, checked in by oabramkina, 22 months ago

Dev: adding exception handling.

To activate it, compilation flag -DXIOS_EXCEPTION should be added.

  • 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_CAttribute__
2#define __XIOS_CAttribute__
[219]3
4/// boost headers ///
5#include <boost/any.hpp>
6
[591]7/// XIOS headers ///
8#include "xios_spl.hpp"
[219]9#include "object.hpp"
[300]10#include "base_type.hpp"
11#include "message.hpp"
12#include "buffer_in.hpp"
13#include "buffer_out.hpp"
[219]14
[335]15namespace xios
[219]16{
17      /// ////////////////////// Déclarations ////////////////////// ///
[1158]18   /*!
19   \class CAttribute
20      The fundamental class which describes the attributes of other different class in XIOS.
21      This class only plays a role of interface, its class child will have specific implelemtation corresponding to type of attribute
22   */
[369]23      class CAttribute : public CObject, public virtual CBaseType
[219]24      {
25            typedef CObject SuperClass;
26
27         public :
28
29            /// Constructeurs ///
30            explicit CAttribute(const StdString & id);
31
32            /// Accesseurs ///
33            const StdString & getName(void) const;
34
[369]35            virtual void set(const CAttribute& ) =0 ;
[460]36            virtual void reset(void ) =0 ;
[219]37            /// Destructeur ///
38            virtual ~CAttribute(void);
39
40            /// Autres ///
41            virtual StdString toString(void) const = 0;
42            virtual void fromString(const StdString & str) = 0;
[1612]43            virtual StdString dump(void) const = 0;
[1158]44            virtual bool isEqual(const CAttribute& ) = 0;
[219]45
[778]46            //! Returns true if and only if the attribute should be publicly exposed in the API
47            virtual bool isPublic() const { return true; }
[1025]48           
49            //! Return true if the attribute should be sent to other clients or servers
50            virtual bool doSend() const { return true; }
[778]51
[1158]52            /*
53              Groupd of functions to generate C and Fortran interface
54            */
[313]55            virtual void generateCInterface(ostream& oss, const string& className) = 0 ;
[432]56            virtual void generateCInterfaceIsDefined(ostream& oss, const string& className) ;
[313]57            virtual void generateFortran2003Interface(ostream& oss, const string& className) = 0 ;
[432]58            virtual void generateFortran2003InterfaceIsDefined(ostream& oss, const string& className) ;
[313]59            virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) = 0 ;
60            virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) = 0 ;
61            virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) = 0 ;
62            virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) = 0 ;
63            virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) = 0 ;
64            virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) = 0 ;
[432]65            virtual void generateFortranInterfaceIsDefinedDeclaration_(ostream& oss,const string& className) ;
66            virtual void generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className)  ;
67            virtual void generateFortranInterfaceIsDefinedBody_(ostream& oss,const string& className) ;
[219]68
[445]69            virtual void setInheritedValue(const CAttribute& ) = 0 ;
70            virtual bool hasInheritedValue(void) const = 0;
[219]71
[1158]72            bool canInherite(void) {return _canInherite ;}
73         protected : 
74            bool _canInherite ;
75            static const StdString resetInheritanceStr ; 
[219]76
77      }; // class CAttribute
78
[345]79   CMessage& operator<<(CMessage& msg,CAttribute& type) ;
80   CMessage& operator<<(CMessage& msg, const CAttribute&  type) ;
[300]81 
[345]82   CBufferOut& operator<<(CBufferOut& buffer,CAttribute& type) ;
83   CBufferIn& operator>>(CBufferIn& buffer, CAttribute&  type) ;
[369]84
[300]85}
[335]86  // namespace xios
[219]87
[591]88#endif // __XIOS_CAttribute__
Note: See TracBrowser for help on using the repository browser.