Ignore:
Timestamp:
10/16/12 13:04:44 (12 years ago)
Author:
ymipsl
Message:

Major Update

  • redesign Type and attribute manipulation
  • add enumerate type and attribute
  • use blitz class array instead of boost class array

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/attribute_template.hpp

    r354 r369  
    88#include "xmlioserver_spl.hpp" 
    99#include "exception.hpp" 
    10 #include "array.hpp" 
    1110#include "attribute.hpp" 
    1211#include "buffer_in.hpp" 
    1312#include "buffer_out.hpp" 
     13#include "type.hpp" 
    1414 
    1515 
     
    1818      /// ////////////////////// Déclarations ////////////////////// /// 
    1919      template <class T> 
    20          class CAttributeTemplate : public CAttribute 
     20         class CAttributeTemplate : public CAttribute, public CType<T> 
    2121      { 
    2222            typedef CAttribute SuperClass; 
     
    3434            CAttributeTemplate(const StdString & id, const ValueType & value, 
    3535                               xios_map<StdString, CAttribute*> & umap); 
    36             CAttributeTemplate(const CAttribute & attribut) throw (CException); 
    37             CAttributeTemplate(const CAttribute * const attribut); // Not implemented. 
     36//            CAttributeTemplate(const CAttribute & attribut) throw (CException); 
     37//            CAttributeTemplate(const CAttribute * const attribut); // Not implemented. 
    3838 
    3939          public : 
     
    4141            /// Accesseur /// 
    4242            ValueType getValue(void) const; 
    43             ValueType* getRef(void) ; 
     43//            ValueType* getRef(void) ; 
    4444 
    4545            /// Mutateurs /// 
    4646            void setValue(const ValueType & value); 
    47  
     47             
     48            void set(const CAttribute& attr) ; 
     49            void set(const CAttributeTemplate& attr) ; 
     50             
    4851            /// Destructeur /// 
    49             virtual ~CAttributeTemplate(void); 
     52            virtual ~CAttributeTemplate(void) { } 
    5053 
    5154            /// Operateur /// 
    52             ValueType operator=(const ValueType & value); 
     55            CAttributeTemplate& operator=(const ValueType & value); 
    5356 
    5457            /// Autre /// 
    55             virtual StdString toString(void) const; 
    56             virtual void fromString(const StdString & str); 
     58            virtual StdString toString(void) const { return _toString();} 
     59            virtual void fromString(const StdString & str) { _fromString(str);} 
     60//            virtual CAttributeTemplate* clone() const {} 
     61//            virtual void toBinary  (StdOStream & os) const; 
     62//            virtual void fromBinary(StdIStream & is);             
    5763 
    58             virtual void toBinary  (StdOStream & os) const; 
    59             virtual void fromBinary(StdIStream & is);             
    60  
    61             virtual bool toBuffer  (CBufferOut& buffer) const; 
    62             virtual bool fromBuffer(CBufferIn& buffer) ; 
    63             virtual size_t size(void) const; 
     64            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);}  
     65            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); }  
     66//            virtual size_t size(void) const; 
    6467            virtual void generateCInterface(ostream& oss,const string& className) ; 
    6568            virtual void generateFortran2003Interface(ostream& oss,const string& className) ; 
     
    7578 
    7679            /// Constructeurs /// 
    77             CAttributeTemplate(void); // Not implemented. 
    78  
     80//            CAttributeTemplate(void); // Not implemented. 
     81         private : 
     82          StdString _toString(void) const; 
     83          void _fromString(const StdString & str); 
     84          bool _toBuffer  (CBufferOut& buffer) const; 
     85          bool _fromBuffer(CBufferIn& buffer) ; 
    7986      }; // class CAttribute     
    8087       
Note: See TracChangeset for help on using the changeset viewer.