31 #ifndef GENAPI_REGISTERT_H 32 #define GENAPI_REGISTERT_H 34 #include "../IRegister.h" 35 #include "GenApi/impl/Log.h" 40 # define _snprintf snprintf 47 # pragma warning ( push ) 48 # pragma warning ( disable : 4996 ) // depcretaced function 63 std::list<CNodeCallback*> CallbacksToFire;
66 typename Base::EntryMethodFinalizer E(
this,
meSet );
71 static const char fmt[] =
73 static const int BufferLen(256);
76 int BufferLeft(
_snprintf(_pBuffer, BufferLen, fmt, Length));
79 for(
int i = 0; i <
Length; i++)
81 const int n =
_snprintf(_pBuffer + BufferLeft,
82 BufferLen - BufferLeft,
83 "%02X", (
unsigned int) pBuffer[i]);
84 #pragma BullseyeCoverage off 88 if (BufferLeft + n >= BufferLen)
91 #pragma BullseyeCoverage on 103 typename Base::PostSetValueFinalizer PostSetValueCaller(
this, CallbacksToFire);
106 Base::InternalSet(pBuffer, Length);
109 Base::InternalCheckError();
115 std::list<CNodeCallback*>::iterator ptrCallback;
116 for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
123 std::list<CNodeCallback*>::iterator ptrCallback;
124 for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
135 typename Base::EntryMethodFinalizer E(
this,
meGet, IgnoreCache );
143 Base::InternalGet(pBuffer, Length,
Verify, IgnoreCache );
146 Base::InternalCheckError();
150 static const char fmt[] =
151 "...Get( %" FMT_I64 "d ) = 0x";
153 static const int BufferLen(256);
155 int BufferLeft(
_snprintf(_pBuffer, BufferLen, fmt, Length));
158 for(
int i = 0; i <
Length; i++)
160 const int n =
_snprintf(_pBuffer + BufferLeft,
161 BufferLen - BufferLeft,
162 "%02X", (
unsigned int) pBuffer[i]);
163 #pragma BullseyeCoverage off 168 if (BufferLeft + n >= BufferLen)
171 #pragma BullseyeCoverage on 183 return Base::InternalGetLength();
191 return Base::InternalGetAddress(
false,
false);
196 # pragma warning ( pop ) 201 #endif // GENAPI_REGISTERT_H
virtual int64_t GetLength()
Implementation of IRegister::GetLength()
Implementation of the IRegister interface.
static bool IsInfoEnabled(LOG4CPP_NS::Category *aCategory)
Check whether logging is possible and enabled for a specific category.
bool IsReadable(EAccessMode AccessMode)
Tests if readable.
#define ACCESS_EXCEPTION_NODE
Fires a access error exception, e.g. throw ACCESS_ERROR_EXCEPTION("Not everybody") ...
virtual void Get(uint8_t *pBuffer, int64_t Length, bool Verify=false, bool IgnoreCache=false)
Implementation of IRegister::Get()
Definition of macros for cross-platform compatibility.
interface GENAPI_DECL_ABSTRACT bool Verify
#define GCLOGINFOPUSH(cat,...)
virtual void Set(const uint8_t *pBuffer, int64_t Length, bool Verify=true)
Implementation of IRegister::Set()
interface GENAPI_DECL_ABSTRACT int64_t int64_t Length
bool IsWritable(EAccessMode AccessMode)
Tests if writable.
#define GCLOGINFOPOP(cat,...)
virtual int64_t GetAddress()
Retrieves the Address of the register.
Part of the generic device API.
callback is fired on leaving the tree inside the lock-guarded area
virtual CLock & GetLock() const =0
Returns the lock which guards the node map.