31 #ifndef GENAPI_INTEGERT_H 32 #define GENAPI_INTEGERT_H 34 #include "../Compatibility.h" 35 #include "../IInteger.h" 38 #include "GenApi/impl/Log.h" 65 std::list<CNodeCallback*> CallbacksToFire;
68 typename Base::EntryMethodFinalizer E(
this,
meSetValue );
70 Base::m_ValueCacheValid =
false;
79 CHECK_RANGE_I64_NODE( Value, Base::InternalGetMin(), Base::InternalGetMax(), Base::InternalGetInc() );
83 typename Base::PostSetValueFinalizer PostSetValueCaller(
this, CallbacksToFire);
89 Base::InternalSetValue(Value,
Verify);
92 Base::InternalCheckError();
94 #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) 99 Base::m_ValueCacheValid =
true;
100 Base::m_DontDeleteThisCache =
true;
109 std::list<CNodeCallback*>::iterator ptrCallback;
110 for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
117 std::list<CNodeCallback*>::iterator ptrCallback;
118 for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
135 if (!
String2Value(ValueStr, &Value, Base::InternalGetRepresentation()))
145 typename Base::EntryMethodFinalizer E(
this,
meGetValue, IgnoreCache );
151 #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) 153 if ( !IgnoreCache && Base::m_ValueCacheValid && !
Verify)
162 const int64_t Value( Base::InternalGetValue(
Verify, IgnoreCache ) );
166 CHECK_RANGE_I64_NODE( Value, Base::InternalGetMin(), Base::InternalGetMax(), Base::InternalGetInc() );
167 Base::InternalCheckError();
170 #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) 178 Base::m_ValueCacheValid =
true;
204 Value2String(Value, ValueStr, Base::InternalGetRepresentation() );
213 typename Base::EntryMethodFinalizer(
this,
meGetMin );
221 int64_t Minimum = Base::InternalGetMin();
234 typename Base::EntryMethodFinalizer(
this,
meGetMax );
242 int64_t Maximum = Base::InternalGetMax();
253 typename Base::EntryMethodFinalizer(
this,
meGetIncMode );
257 if( ! Base::m_ListOfValidValuesCacheValid )
260 Base::m_ListOfValidValuesCacheValid =
true;
273 typename Base::EntryMethodFinalizer(
this,
meGetInc );
281 const int64_t Increment(Base::InternalGetInc());
292 GCLOGINFOPUSH( Base::m_pRangeLog,
"GetListOfValidValues...");
294 if( ! Base::m_ListOfValidValuesCacheValid )
297 Base::m_ListOfValidValuesCacheValid =
true;
302 GCLOGINFOPOP( Base::m_pRangeLog,
"...GetListOfValidValues");
314 return Base::InternalGetRepresentation();
321 return Base::InternalGetUnit();
int64_t m_ImposedMax
a Value imposed to the maximum
const _autovector_impl duplicate(T min, T max)
#define GCLOGINFO(cat,...)
virtual int64_t GetInc()
Implementation of IInteger::GetInc()
virtual void ImposeMin(int64_t Value)
Restrict minimum value.
virtual int64_t GetMin()
Implementation of IInteger::GetMin()
virtual int64_t operator()()
Implementation of IInteger::operator()()
GENICAM_NAMESPACE::gcstring InternalToString(bool Verify=false, bool IgnoreCache=false)
virtual int64_autovector_t GetListOfValidValues(bool bounded=true)
Implementation of IInteger::GetListOfValidValues.
virtual int64_t GetValue(bool Verify=false, bool IgnoreCache=false)
Implementation of IInteger::GetValue()
bool IsReadable(EAccessMode AccessMode)
Tests if readable.
interface GENAPI_DECL_ABSTRACT IInteger
Interface for integer properties.
virtual void ImposeMax(int64_t Value)
Restrict maximum value.
virtual EIncMode GetIncMode()
Implementation of IInteger::GetIncMode.
#define INVALID_ARGUMENT_EXCEPTION_NODE
Fires an invalid argument exception, e.g. throw INVALID_ARGUMENT("%ld too large", Value);...
virtual ERepresentation GetRepresentation()
Implementation of IInteger::GetRepresentation.
bool IsAvailable(EAccessMode AccessMode)
Tests if available.
Write to cache and register.
#define CHECK_RANGE_I64_NODE(_Value, _Min, _Max, _Inc)
Range check for int64.
enum GENAPI_NAMESPACE::_ERepresentation ERepresentation
recommended representation of a node value
int64_t m_ImposedMin
a Value imposed to the minimum
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
int64_autovector_impl m_CurentValidValueSet
The cached list of valie value for the integer.
Vector of integers with reference counting.
virtual IInteger & operator=(int64_t Value)
Implementation of IInteger::operator=()
Write to register, write to cache on read.
Implementation of the IInteger Interface.
#define ACCESS_EXCEPTION_NODE
Fires a access error exception, e.g. throw ACCESS_ERROR_EXCEPTION("Not everybody") ...
Invalidate the node and all of its dependents.
virtual int64_t operator*()
Implementation of IInteger::operator*()
interface GENAPI_DECL_ABSTRACT bool Verify
#define GCLOGINFOPUSH(cat,...)
virtual void SetValue(int64_t Value, bool Verify=true)
Implementation of IInteger::SetValue.
This file contains the internal implementation of the autovector.
virtual int64_t GetMax()
Implementation of IInteger::GetMax()
A string class which is a clone of std::string.
virtual GENICAM_NAMESPACE::gcstring GetUnit()
Implementation of IInteger::GetUnit()
int64_t m_ValueCache
The cache for the integer value.
virtual ECachingMode GetCachingMode() const =0
Get Caching Mode.
bool IsWritable(EAccessMode AccessMode)
Tests if writable.
virtual void SetInvalid(ESetInvalidMode simMode)=0
Invalidate the node resp. the node and all of its dependents.
enum GENAPI_NAMESPACE::_EIncMode EIncMode
typedef for increment mode
#define GCLOGINFOPOP(cat,...)
virtual const char * c_str(void) const
void Value2String(T Value, GENICAM_NAMESPACE::gcstring &ValueStr)
Converts an T property to a string.
Part of the generic device API.
callback is fired on leaving the tree inside the lock-guarded area
void InternalFromString(const GENICAM_NAMESPACE::gcstring &ValueStr, bool Verify=true)
virtual CLock & GetLock() const =0
Returns the lock which guards the node map.
bool String2Value(const GENICAM_NAMESPACE::gcstring &ValueStr, T *Value)
Converts a string to an T property.