TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/property/OfxhGetHook.cpp
Go to the documentation of this file.
00001 #include "OfxhGetHook.hpp"
00002 
00003 namespace tuttle {
00004 namespace host {
00005 namespace ofx {
00006 namespace property {
00007 
00008 /// this does some magic so that it calls get string/int/double/pointer appropriately
00009 template<>
00010 int OfxhGetHook::getProperty<OfxhIntValue>( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00011 {
00012         return getIntProperty( name, index );
00013 }
00014 
00015 /// this does some magic so that it calls get string/int/double/pointer appropriately
00016 template<>
00017 double OfxhGetHook::getProperty<OfxhDoubleValue>( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00018 {
00019         return getDoubleProperty( name, index );
00020 }
00021 
00022 /// this does some magic so that it calls get string/int/double/pointer appropriately
00023 template<>
00024 void* OfxhGetHook::getProperty<OfxhPointerValue>( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00025 {
00026         return getPointerProperty( name, index );
00027 }
00028 
00029 /// this does some magic so that it calls get string/int/double/pointer appropriately
00030 template<>
00031 const std::string& OfxhGetHook::getProperty<OfxhStringValue>( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00032 {
00033         return getStringProperty( name, index );
00034 }
00035 
00036 /// this does some magic so that it calls get string/int/double/pointer appropriately
00037 
00038 template<>
00039 void OfxhGetHook::getPropertyN<OfxhIntValue>( const std::string& name, int* values, int count ) const OFX_EXCEPTION_SPEC
00040 {
00041         getIntPropertyN( name, values, count );
00042 }
00043 
00044 /// this does some magic so that it calls get string/int/double/pointer appropriately
00045 template<>
00046 void OfxhGetHook::getPropertyN<OfxhDoubleValue>( const std::string& name, double* values, int count ) const OFX_EXCEPTION_SPEC
00047 {
00048         getDoublePropertyN( name, values, count );
00049 }
00050 
00051 /// this does some magic so that it calls get string/int/double/pointer appropriately
00052 template<>
00053 void OfxhGetHook::getPropertyN<OfxhPointerValue>( const std::string& name, void** values, int count ) const OFX_EXCEPTION_SPEC
00054 {
00055         getPointerPropertyN( name, values, count );
00056 }
00057 
00058 /// override this to get a single value at the given index.
00059 const std::string& OfxhGetHook::getStringProperty( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00060 {
00061         #ifdef DEBUG_PROPERTIES
00062         std::cout << "Calling un-overriden GetHook::getStringProperty!!!! " << std::endl;
00063         #endif
00064         return OfxhStringValue::kEmpty;
00065 }
00066 
00067 /// override this to fetch a single value at the given index.
00068 int OfxhGetHook::getIntProperty( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00069 {
00070         #ifdef DEBUG_PROPERTIES
00071         std::cout << "Calling un-overriden GetHook::getIntProperty!!!! " << std::endl;
00072         #endif
00073         return 0;
00074 }
00075 
00076 /// override this to fetch a single value at the given index.
00077 double OfxhGetHook::getDoubleProperty( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00078 {
00079         #ifdef DEBUG_PROPERTIES
00080         std::cout << "Calling un-overriden GetHook::getDoubleProperty!!!! " << std::endl;
00081         #endif
00082         return 0;
00083 }
00084 
00085 /// override this to fetch a single value at the given index.
00086 void* OfxhGetHook::getPointerProperty( const std::string& name, int index ) const OFX_EXCEPTION_SPEC
00087 {
00088         #ifdef DEBUG_PROPERTIES
00089         std::cout << "Calling un-overriden GetHook::getPointerProperty!!!! " << std::endl;
00090         #endif
00091         return NULL;
00092 }
00093 
00094 /// override this to fetch a multiple values in a multi-dimension property
00095 void OfxhGetHook::getDoublePropertyN( const std::string& name, double* values, int count ) const OFX_EXCEPTION_SPEC
00096 {
00097         #ifdef DEBUG_PROPERTIES
00098         std::cout << "Calling un-overriden GetHook::getDoublePropertyN!!!! " << std::endl;
00099         #endif
00100         memset( values, 0, sizeof( double ) * count );
00101 }
00102 
00103 /// override this to fetch a multiple values in a multi-dimension property
00104 void OfxhGetHook::getIntPropertyN( const std::string& name, int* values, int count ) const OFX_EXCEPTION_SPEC
00105 {
00106         #ifdef DEBUG_PROPERTIES
00107         std::cout << "Calling un-overriden GetHook::getIntPropertyN!!!! " << std::endl;
00108         #endif
00109         memset( values, 0, sizeof( int ) * count );
00110 }
00111 
00112 /// override this to fetch a multiple values in a multi-dimension property
00113 void OfxhGetHook::getPointerPropertyN( const std::string& name, void** values, int count ) const OFX_EXCEPTION_SPEC
00114 {
00115         #ifdef DEBUG_PROPERTIES
00116         std::cout << "Calling un-overriden GetHook::getPointerPropertyN!!!! " << std::endl;
00117         #endif
00118         memset( values, 0, sizeof( void* ) * count );
00119 }
00120 
00121 /// override this to fetch the dimension size.
00122 size_t OfxhGetHook::getDimension( const std::string& name ) const OFX_EXCEPTION_SPEC
00123 {
00124         #ifdef DEBUG_PROPERTIES
00125         std::cout << "Calling un-overriden GetHook::getDimension!!!! " << std::endl;
00126         #endif
00127         return 0;
00128 }
00129 
00130 /// override this to handle a reset().
00131 void OfxhGetHook::reset( const std::string& name ) OFX_EXCEPTION_SPEC
00132 {
00133         #ifdef DEBUG_PROPERTIES
00134         std::cout << "Calling un-overriden GetHook::reset!!!! " << std::endl;
00135         #endif
00136 }
00137 
00138 }
00139 }
00140 }
00141 }