TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/attribute/OfxhParamBoolean.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_HOST_OFX_PARAM_PARAMBOOLEAN_HPP_
00002 #define _TUTTLE_HOST_OFX_PARAM_PARAMBOOLEAN_HPP_
00003 
00004 #include "OfxhParam.hpp"
00005 #include "OfxhParamDescriptor.hpp"
00006 #include "OfxhParamSet.hpp"
00007 #include "OfxhKeyframeParam.hpp"
00008 
00009 namespace tuttle {
00010 namespace host {
00011 namespace ofx {
00012 namespace attribute {
00013 
00014 class OfxhParamBoolean
00015         : public OfxhParam
00016         , public OfxhKeyframeParam
00017 {
00018 protected:
00019         std::size_t _index;
00020 
00021 public:
00022         typedef bool BaseType;
00023         OfxhParamBoolean( const OfxhParamDescriptor& descriptor, const std::string& name, OfxhParamSet& setInstance, const std::size_t index = 0 )
00024                 : OfxhParam( descriptor, name, setInstance )
00025                 , _index( index )
00026         {}
00027 
00028         // Deriving implementatation needs to overide these
00029         virtual void getValue( bool& ) const OFX_EXCEPTION_SPEC                                                 = 0;
00030         virtual void getValueAtTime( const OfxTime time, bool& ) const OFX_EXCEPTION_SPEC                       = 0;
00031         virtual void setValue( const bool&, const EChange change ) OFX_EXCEPTION_SPEC                           = 0;
00032         virtual void setValueAtTime( const OfxTime time, const bool&, const EChange change ) OFX_EXCEPTION_SPEC = 0;
00033 
00034         virtual void setValue( const int& v, const EChange change ) OFX_EXCEPTION_SPEC
00035         {
00036                 setValue( bool(v), change );
00037         }
00038 
00039         virtual void setValueAtTime( const OfxTime time, const int& v, const EChange change ) OFX_EXCEPTION_SPEC
00040         {
00041                 setValueAtTime( time, bool(v), change );
00042         }
00043 
00044 #ifndef SWIG
00045         /// implementation of var args function
00046         virtual void getV( va_list arg ) const OFX_EXCEPTION_SPEC;
00047 
00048         /// implementation of var args function
00049         virtual void getV( const OfxTime time, va_list arg ) const OFX_EXCEPTION_SPEC;
00050 
00051         /// implementation of var args function
00052         virtual void setV( va_list arg, const EChange change ) OFX_EXCEPTION_SPEC;
00053 
00054         /// implementation of var args function
00055         virtual void setV( const OfxTime time, va_list arg, const EChange change ) OFX_EXCEPTION_SPEC;
00056 #endif
00057 
00058         bool paramTypeHasData() const { return true; }
00059 
00060         std::size_t getHashAtTime( const OfxTime time ) const;  
00061 };
00062 
00063 }
00064 }
00065 }
00066 }
00067 
00068 #endif
00069