source: XIOS/trunk/src/attribute.hpp @ 539

Last change on this file since 539 was 501, checked in by ymipsl, 10 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

  • 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: 4.3 KB
RevLine 
[219]1#ifndef __XMLIO_CAttribute__
2#define __XMLIO_CAttribute__
3
4/// boost headers ///
5#include <boost/any.hpp>
6
[335]7/// xios headers ///
[219]8#include "xmlioserver_spl.hpp"
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 ////////////////////// ///
[369]18      class CAttribute : public CObject, public virtual CBaseType
[219]19      {
20            typedef CObject SuperClass;
21
22         public :
23
24            /// Constructeurs ///
25            explicit CAttribute(const StdString & id);
[369]26//            CAttribute(const CAttribute & attribut);
27//            CAttribute(const CAttribute * const attribut); // Not implemented.
[219]28
29            /// Accesseurs ///
30            const StdString & getName(void) const;
[369]31//            const boost::any & getAnyValue(void) const;
32//            template <typename T> inline T getValue(void) const;
33//            template <typename T> inline T* getRef(void);
[219]34
[369]35//            /// Mutateurs ///
36//            template <typename T> inline void setValue(const T & value);
37//            void setAnyValue(const boost::any & value);
38//            void clear(void);
[219]39
40            /// Test ///
[369]41//            bool isEmpty(void) const;
42//            template <typename T> inline bool isType(void) const;
43            virtual void set(const CAttribute& ) =0 ;
[460]44            virtual void reset(void ) =0 ;
[219]45            /// Destructeur ///
46            virtual ~CAttribute(void);
47
48            /// Autres ///
49            virtual StdString toString(void) const = 0;
50            virtual void fromString(const StdString & str) = 0;
51
[369]52//            virtual void toBinary  (StdOStream & os) const = 0;
53//            virtual void fromBinary(StdIStream & is) = 0;
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;
[313]71           
[219]72         protected :
73
74            /// Constructeurs ///
[369]75//            CAttribute(void);  // Not implemented.
[219]76
77            /// Propriété ///
[369]78//            boost::any value;
[219]79
80      }; // class CAttribute
81
82      /// ////////////////////// Définitions ////////////////////// ///
[369]83/*
[219]84      template <typename T>
85         T CAttribute::getValue(void) const
86      {
87         return (boost::any_cast<T>(this->value));
88      }
89
90      template <typename T>
[300]91         T* CAttribute::getRef(void)
92      {
93         return (boost::any_cast<T>(&value));
94      }
95
96      template <typename T>
[219]97         void CAttribute::setValue(const T & value)
98      {
99         this->value = value;
100      }
101
102      template<typename T>
[352]103         bool CAttribute::isType(void) const
[219]104      {
105         return (this->value.type() == typeid(T));
106      }
[369]107*/
[300]108 
[345]109   CMessage& operator<<(CMessage& msg,CAttribute& type) ;
110   CMessage& operator<<(CMessage& msg, const CAttribute&  type) ;
[300]111 
[345]112   CBufferOut& operator<<(CBufferOut& buffer,CAttribute& type) ;
113   CBufferIn& operator>>(CBufferIn& buffer, CAttribute&  type) ;
[369]114
[300]115}
[335]116  // namespace xios
[219]117
118#endif // __XMLIO_CAttribute__
Note: See TracBrowser for help on using the repository browser.