source: XIOS/trunk/src/attribute.cpp @ 394

Last change on this file since 394 was 369, checked in by ymipsl, 12 years ago

Major Update

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

YM

File size: 2.2 KB
RevLine 
[219]1#include "attribute.hpp"
[300]2#include "base_type.hpp"
[219]3
[335]4namespace xios
[219]5{
6      /// ////////////////////// Définitions ////////////////////// ///
7      CAttribute::CAttribute(const StdString & id)
[300]8         : CObject(id), CBaseType()
[369]9//         , value()
[219]10      { /* Ne rien faire de plus */ }
[369]11/*
[219]12      CAttribute::CAttribute(const CAttribute & attribut)
[300]13         : CObject(attribut.getId()),CBaseType()
[219]14      {
[369]15 //        this->value = attribut.getAnyValue();
[219]16      }
[369]17*/     
[219]18      CAttribute::~CAttribute(void)
19      { /* Ne rien faire de plus */ }
20     
21      ///--------------------------------------------------------------
[369]22/*
[219]23      const boost::any & CAttribute::getAnyValue(void) const
24      {
25         return (this->value);
26      }
27
28
29      void CAttribute::setAnyValue(const boost::any & value)
30      {
31         this->value = value;
32      }
33     
34      void CAttribute::clear(void)
35      {
36         this->value = boost::any();
37      }
38
39      //---------------------------------------------------------------
40
41      bool CAttribute::isEmpty(void) const
42      {
43         return (this->value.empty());
44      }
[369]45*/
[219]46      const StdString & CAttribute::getName(void) const
47      { 
48         return (this->getId()); 
49      }
50     
[300]51
[219]52      ///--------------------------------------------------------------
53
[369]54
[345]55      CMessage& operator<<(CMessage& msg,CAttribute& type)
[300]56      {
57        msg.push(type) ;
58        return msg ;
59      }
60
[345]61     CMessage& operator<<(CMessage& msg, const CAttribute&  type)
[300]62     {
[369]63//       msg.push(*type.clone()) ;
[300]64       return msg ;
65     }
66 
[345]67      CBufferOut& operator<<(CBufferOut& buffer, CAttribute&  type)
[300]68     {
69   
[345]70       if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CAttribute&  type)",
[300]71                                           <<"Buffer remain size is to low for size type") ;
72      return buffer ;
73     }
74     
[345]75     CBufferIn& operator>>(CBufferIn& buffer, CAttribute&  type)
[300]76     {
77   
[345]78       if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, CAttribute&  type)",
[300]79                                           <<"Buffer remain size is to low for size type") ;
80       return buffer ;
81     }
82
[335]83} // namespace xios
Note: See TracBrowser for help on using the repository browser.