TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/attribute/OfxhAttributeDescriptor.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_HOST_OFX_ATTRIBUTE_ATTRIBUTEDESCRIPTOR_HPP_
00002 #define _TUTTLE_HOST_OFX_ATTRIBUTE_ATTRIBUTEDESCRIPTOR_HPP_
00003 
00004 #include "OfxhAttributeAccessor.hpp"
00005 #include <tuttle/host/ofx/property/OfxhSet.hpp>
00006 
00007 namespace tuttle {
00008 namespace host {
00009 namespace ofx {
00010 namespace attribute {
00011 
00012 class OfxhAttributeDescriptor
00013         : virtual public OfxhAttributeAccessor
00014 {
00015 public:
00016         typedef OfxhAttributeDescriptor This;
00017 
00018 private:
00019         OfxhAttributeDescriptor( const OfxhAttributeDescriptor& other );
00020 
00021 public:
00022         OfxhAttributeDescriptor();
00023         OfxhAttributeDescriptor( const property::OfxhSet& properties );
00024         virtual ~OfxhAttributeDescriptor() = 0;
00025 
00026 protected:
00027         property::OfxhSet _properties;
00028 
00029 protected:
00030         void setProperties( const property::OfxhSet& properties )
00031         {
00032                 _properties = properties;
00033                 assert( getAttributeType().c_str() );
00034         }
00035 
00036 public:
00037         bool operator==( const This& other ) const
00038         {
00039                 if( _properties != other._properties )
00040                         return false;
00041                 return true;
00042         }
00043 
00044         bool operator!=( const This& other ) const { return !This::operator==( other ); }
00045 
00046         const property::OfxhSet& getProperties() const
00047         {
00048                 return _properties;
00049         }
00050 
00051         property::OfxhSet& getEditableProperties()
00052         {
00053                 return _properties;
00054         }
00055 
00056 private:
00057         friend class boost::serialization::access;
00058         template<class Archive>
00059         void serialize( Archive& ar, const unsigned int version )
00060         {
00061                 ar& BOOST_SERIALIZATION_NVP( _properties );
00062         }
00063 
00064 };
00065 
00066 }
00067 }
00068 }
00069 }
00070 
00071 #endif
00072