TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/attribute/OfxhClip.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_HOST_OFX_ATTRIBUTE_CLIP_HPP_
00002 #define _TUTTLE_HOST_OFX_ATTRIBUTE_CLIP_HPP_
00003 
00004 #include "OfxhAttribute.hpp"
00005 #include "OfxhClipAccessor.hpp"
00006 
00007 #include <tuttle/host/ofx/OfxhUtilities.hpp>
00008 #include <tuttle/host/ofx/property/OfxhSet.hpp>
00009 #include <tuttle/host/ofx/property/OfxhGetHook.hpp>
00010 #include <tuttle/host/ofx/property/OfxhNotifyHook.hpp>
00011 
00012 namespace tuttle {
00013 namespace host {
00014 namespace ofx {
00015 namespace attribute {
00016 
00017 class OfxhClipDescriptor;
00018 
00019 /**
00020  * a clip instance
00021  */
00022 class OfxhClip
00023         : public OfxhAttribute
00024         , protected property::OfxhGetHook
00025         , protected property::OfxhNotifyHook
00026         , virtual public OfxhClipAccessor
00027         , private boost::noncopyable
00028 {
00029 public:
00030         typedef OfxhClip This;
00031 
00032 protected:
00033         OfxhClip( const OfxhClip& other ) : OfxhAttribute( other ) {}
00034 
00035 public:
00036         OfxhClip( const OfxhClipDescriptor& desc );
00037         virtual ~OfxhClip() = 0;
00038 
00039         /// clone this clip
00040         virtual OfxhClip* clone() const = 0;
00041 
00042         virtual bool operator==( const This& other ) const
00043         {
00044                 if( OfxhAttribute::operator!=( other ) )
00045                         return false;
00046                 return true;
00047         }
00048 
00049         bool operator!=( const This& other ) const { return !This::operator==( other ); }
00050 
00051         virtual std::string getFullName() const = 0;
00052         
00053 #ifndef SWIG
00054         void initHook( const property::OfxhPropSpec* propSpec );
00055 
00056         /// notify override properties
00057         void notify( const std::string& name, bool isSingle, int indexOrN ) OFX_EXCEPTION_SPEC
00058         {
00059                 TUTTLE_LOG_INFOS;
00060                 TUTTLE_LOG_ERROR( "What we should do here?" );
00061                 BOOST_THROW_EXCEPTION( OfxhException( kOfxStatErrMissingHostFeature ) );
00062         }
00063 
00064         // don't know what to do
00065         void reset( const std::string& name ) OFX_EXCEPTION_SPEC
00066         {
00067                 TUTTLE_LOG_INFOS;
00068                 TUTTLE_LOG_ERROR( "What we should do here?" );
00069                 BOOST_THROW_EXCEPTION( OfxhException( kOfxStatErrMissingHostFeature ) );
00070         }
00071 #endif
00072 
00073 private:
00074         friend class boost::serialization::access;
00075         template<class Archive>
00076         void serialize( Archive& ar, const unsigned int version )
00077         {
00078                 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP( OfxhAttribute );
00079         }
00080 
00081 };
00082 
00083 #ifndef SWIG
00084 /**
00085  * @brief to make clonable for use in boost::ptr_container.
00086  */
00087 inline OfxhClip* new_clone( const OfxhClip& a )
00088 {
00089         return a.clone();
00090 }
00091 
00092 #endif
00093 
00094 }
00095 }
00096 }
00097 }
00098 
00099 // force boost::is_virtual_base_of value (used by boost::serialization)
00100 namespace boost {
00101 template<>
00102 struct is_virtual_base_of<tuttle::host::ofx::attribute::OfxhAttribute, tuttle::host::ofx::attribute::OfxhClip>: public mpl::true_ {};
00103 }
00104 
00105 #endif
00106