TuttleOFX  1
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 #ifndef SWIG
00052         void initHook( const property::OfxhPropSpec* propSpec );
00053 
00054         /// notify override properties
00055         void notify( const std::string& name, bool isSingle, int indexOrN ) OFX_EXCEPTION_SPEC
00056         {
00057                 TUTTLE_LOG_INFOS;
00058                 TUTTLE_LOG_ERROR( "What we should do here?" );
00059                 BOOST_THROW_EXCEPTION( OfxhException( kOfxStatErrMissingHostFeature ) );
00060         }
00061 
00062         // don't know what to do
00063         void reset( const std::string& name ) OFX_EXCEPTION_SPEC
00064         {
00065                 TUTTLE_LOG_INFOS;
00066                 TUTTLE_LOG_ERROR( "What we should do here?" );
00067                 BOOST_THROW_EXCEPTION( OfxhException( kOfxStatErrMissingHostFeature ) );
00068         }
00069 #endif
00070 
00071 private:
00072         friend class boost::serialization::access;
00073         template<class Archive>
00074         void serialize( Archive& ar, const unsigned int version )
00075         {
00076                 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP( OfxhAttribute );
00077         }
00078 
00079 };
00080 
00081 #ifndef SWIG
00082 /**
00083  * @brief to make clonable for use in boost::ptr_container.
00084  */
00085 inline OfxhClip* new_clone( const OfxhClip& a )
00086 {
00087         return a.clone();
00088 }
00089 
00090 #endif
00091 
00092 }
00093 }
00094 }
00095 }
00096 
00097 // force boost::is_virtual_base_of value (used by boost::serialization)
00098 namespace boost {
00099 template<>
00100 struct is_virtual_base_of<tuttle::host::ofx::attribute::OfxhAttribute, tuttle::host::ofx::attribute::OfxhClip>: public mpl::true_ {};
00101 }
00102 
00103 #endif
00104