TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/attribute/OfxhParamBoolean.cpp
Go to the documentation of this file.
00001 #include "OfxhParamBoolean.hpp"
00002 
00003 #include <boost/functional/hash.hpp>
00004 
00005 namespace tuttle {
00006 namespace host {
00007 namespace ofx {
00008 namespace attribute {
00009 
00010 /**
00011  * implementation of var args function
00012  */
00013 void OfxhParamBoolean::getV( va_list arg ) const OFX_EXCEPTION_SPEC
00014 {
00015         bool v;
00016 
00017         getValue( v );
00018 
00019         int* value = va_arg( arg, int* );
00020         *value = v;
00021 }
00022 
00023 /**
00024  * implementation of var args function
00025  */
00026 void OfxhParamBoolean::getV( const OfxTime time, va_list arg ) const OFX_EXCEPTION_SPEC
00027 {
00028         bool v;
00029 
00030         getValueAtTime( time, v );
00031 
00032         int* value = va_arg( arg, int* );
00033         *value = v;
00034 }
00035 
00036 /**
00037  * implementation of var args function
00038  */
00039 void OfxhParamBoolean::setV( va_list arg, const EChange change ) OFX_EXCEPTION_SPEC
00040 {
00041         bool value = va_arg( arg, int ) != 0;
00042 
00043         setValue( value, change );
00044 }
00045 
00046 /**
00047  * implementation of var args function
00048  */
00049 void OfxhParamBoolean::setV( const OfxTime time, va_list arg, const EChange change ) OFX_EXCEPTION_SPEC
00050 {
00051         bool value = va_arg( arg, int ) != 0;
00052 
00053         setValueAtTime( time, value, change );
00054 }
00055 
00056 std::size_t OfxhParamBoolean::getHashAtTime( const OfxTime time ) const
00057 {
00058         bool value = false;
00059         getValueAtTime( time, value );
00060         return boost::hash_value( value );
00061 }
00062 
00063 }
00064 }
00065 }
00066 }
00067