Empty client class, written to test registration. More...
#include <uhal/tests/DummyClient.hpp>
Public Member Functions | |
DummyClient (const std::string &aId, const URI &aUri) | |
~DummyClient () | |
Public Member Functions inherited from uhal::ClientInterface | |
virtual | ~ClientInterface () |
Destructor. More... | |
const std::string & | id () const |
Return the identifier of the target for this client. More... | |
const std::string & | uri () const |
Return the url of the target for this client. More... | |
void | dispatch () |
Method to dispatch all queued transactions, and wait until all corresponding responses have been received. More... | |
void | setTimeoutPeriod (const uint32_t &aTimeoutPeriod=0) |
A method to modify the timeout period for any pending or future transactions. More... | |
uint64_t | getTimeoutPeriod () |
A method to retrieve the timeout period currently being used. More... | |
ValHeader | write (const uint32_t &aAddr, const uint32_t &aValue) |
Write a single, unmasked word to a register. More... | |
ValHeader | write (const uint32_t &aAddr, const uint32_t &aValue, const uint32_t &aMask) |
Write a single, masked word to a register. More... | |
ValHeader | writeBlock (const uint32_t &aAddr, const std::vector< uint32_t > &aValues, const defs::BlockReadWriteMode &aMode=defs::INCREMENTAL) |
Write a block of data to a block of registers or a block-write port. More... | |
ValWord< uint32_t > | read (const uint32_t &aAddr) |
Read a single, unmasked, unsigned word. More... | |
ValWord< uint32_t > | read (const uint32_t &aAddr, const uint32_t &aMask) |
Read a single, masked, unsigned word. More... | |
ValVector< uint32_t > | readBlock (const uint32_t &aAddr, const uint32_t &aSize, const defs::BlockReadWriteMode &aMode=defs::INCREMENTAL) |
Read a block of unsigned data from a block of registers or a block-read port. More... | |
ValWord< uint32_t > | rmw_bits (const uint32_t &aAddr, const uint32_t &aANDterm, const uint32_t &aORterm) |
Read the value of a register, apply the AND-term, apply the OR-term, set the register to this new value and return a copy of the original value to the user. More... | |
ValWord< uint32_t > | rmw_sum (const uint32_t &aAddr, const int32_t &aAddend) |
Read the value of a register, add the addend, set the register to this new value and return a copy of the original value to the user. More... | |
Private Member Functions | |
void | implementDispatch (boost::shared_ptr< Buffers > aBuffers) |
Pure virtual function which actually performs the dispatch operation. More... | |
ValHeader | implementBOT () |
Send a byte order transaction. More... | |
ValHeader | implementWrite (const uint32_t &aAddr, const uint32_t &aValue) |
Write a single, unmasked word to a register. More... | |
ValHeader | implementWriteBlock (const uint32_t &aAddr, const std::vector< uint32_t > &aValues, const defs::BlockReadWriteMode &aMode) |
Write a block of data to a block of registers or a block-write port. More... | |
ValWord< uint32_t > | implementRead (const uint32_t &aAddr, const uint32_t &aMask) |
Read a single, masked, unsigned word. More... | |
ValVector< uint32_t > | implementReadBlock (const uint32_t &aAddr, const uint32_t &aSize, const defs::BlockReadWriteMode &aMode) |
Read a block of unsigned data from a block of registers or a block-read port. More... | |
ValWord< uint32_t > | implementRMWbits (const uint32_t &aAddr, const uint32_t &aANDterm, const uint32_t &aORterm) |
Read the value of a register, apply the AND-term, apply the OR-term, set the register to this new value and return a copy of the new value to the user. More... | |
ValWord< uint32_t > | implementRMWsum (const uint32_t &aAddr, const int32_t &aAddend) |
Read the value of a register, add the addend, set the register to this new value and return a copy of the new value to the user. More... | |
exception::exception * | validate (uint8_t *aSendBufferStart, uint8_t *aSendBufferEnd, std::deque< std::pair< uint8_t *, uint32_t > >::iterator aReplyStartIt, std::deque< std::pair< uint8_t *, uint32_t > >::iterator aReplyEndIt) |
Function which the dispatch calls when the reply is received to check that the headers are as expected. More... | |
uint32_t | getMaxNumberOfBuffers () |
Return the maximum number of packets in flight. More... | |
uint32_t | getMaxSendSize () |
Return the maximum size to be sent based on the buffer size in the target. More... | |
uint32_t | getMaxReplySize () |
Return the maximum size of reply packet based on the buffer size in the target. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from uhal::ClientInterface | |
ClientInterface (const std::string &aId, const URI &aUri, const boost::posix_time::time_duration &aTimeoutPeriod) | |
Constructor. More... | |
const boost::posix_time::time_duration & | getBoostTimeoutPeriod () |
A method to retrieve the timeout period currently being used. More... | |
virtual void | Flush () |
Virtual function to dispatch all buffers and block until all replies are received. More... | |
virtual void | preamble (boost::shared_ptr< Buffers > aBuffers) |
Add a preamble to an IPbus buffer. More... | |
virtual uint32_t | getPreambleSize () |
Return the size of the preamble. More... | |
virtual void | predispatch (boost::shared_ptr< Buffers > aBuffers) |
Finalize the buffer before it is transmitted. More... | |
std::pair< ValHeader, _ValHeader_ * > | CreateValHeader () |
Helper function to create a ValHeader object. More... | |
std::pair< ValWord< uint32_t >, _ValWord_< uint32_t > * > | CreateValWord (const uint32_t &aValue, const uint32_t &aMask=defs::NOMASK) |
Helper function to create a ValWord object. More... | |
std::pair< ValVector< uint32_t >, _ValVector_< uint32_t > * > | CreateValVector (const uint32_t &aSize) |
Helper function to create a ValVector object. More... | |
virtual exception::exception * | validate (boost::shared_ptr< Buffers > aBuffers) |
Function which dispatch calls when the reply is received to check that the headers are as expected. More... | |
virtual void | dispatchExceptionHandler () |
Function which is called when an exception is thrown. More... | |
void | returnBufferToPool (boost::shared_ptr< Buffers > &aBuffers) |
Function to return a buffer to the buffer pool. More... | |
void | returnBufferToPool (std::deque< boost::shared_ptr< Buffers > > &aBuffers) |
Function to return a collection of buffers to the buffer pool. More... | |
void | returnBufferToPool (std::vector< boost::shared_ptr< Buffers > > &aBuffers) |
Function to return a collection of buffers to the buffer pool. More... | |
void | returnBufferToPool (std::deque< std::vector< boost::shared_ptr< Buffers > > > &aBuffers) |
Function to return a collection of buffers to the buffer pool. More... | |
virtual boost::shared_ptr< Buffers > | checkBufferSpace (const uint32_t &aSendSize, const uint32_t &aReplySize, uint32_t &aAvailableSendSize, uint32_t &aAvailableReplySize) |
Function which checks the available space in the currently filling buffer against requested send and receive sizes and, if there is insufficient space in the currently filling buffer, then dispatch it and create a new buffer. More... | |
Protected Attributes inherited from uhal::ClientInterface | |
URI | mUri |
a struct containing the full URI of the target for this client More... | |
std::string | mUriString |
Empty client class, written to test registration.
Definition at line 13 of file DummyClient.hpp.
uhal::tests::DummyClient::DummyClient | ( | const std::string & | aId, |
const URI & | aUri | ||
) |
Definition at line 12 of file DummyClient.cpp.
uhal::tests::DummyClient::~DummyClient | ( | ) |
Definition at line 17 of file DummyClient.cpp.
|
privatevirtual |
Return the maximum number of packets in flight.
Implements uhal::ClientInterface.
Definition at line 68 of file DummyClient.cpp.
|
privatevirtual |
Return the maximum size of reply packet based on the buffer size in the target.
Implements uhal::ClientInterface.
Definition at line 78 of file DummyClient.cpp.
|
privatevirtual |
Return the maximum size to be sent based on the buffer size in the target.
Implements uhal::ClientInterface.
Definition at line 73 of file DummyClient.cpp.
|
privatevirtual |
Send a byte order transaction.
Implements uhal::ClientInterface.
Definition at line 25 of file DummyClient.cpp.
|
privatevirtual |
Pure virtual function which actually performs the dispatch operation.
aBuffers | the buffer to be dispatched |
Implements uhal::ClientInterface.
Definition at line 21 of file DummyClient.cpp.
|
privatevirtual |
Read a single, masked, unsigned word.
aAddr | the address of the register to read |
aMask | the mask to apply to the value after reading |
Implements uhal::ClientInterface.
Definition at line 40 of file DummyClient.cpp.
|
privatevirtual |
Read a block of unsigned data from a block of registers or a block-read port.
aAddr | the lowest address in the block of registers or the address of the block-read port |
aSize | the number of words to read |
aMode | whether we are reading from a block of registers (INCREMENTAL) or a block-read port (NON_INCREMENTAL) |
Implements uhal::ClientInterface.
Definition at line 45 of file DummyClient.cpp.
|
privatevirtual |
Read the value of a register, apply the AND-term, apply the OR-term, set the register to this new value and return a copy of the new value to the user.
aAddr | the address of the register to read, modify, write |
aANDterm | the AND-term to apply to existing value in the target register |
aORterm | the OR-term to apply to existing value in the target register |
Implements uhal::ClientInterface.
Definition at line 50 of file DummyClient.cpp.
|
privatevirtual |
Read the value of a register, add the addend, set the register to this new value and return a copy of the new value to the user.
aAddr | the address of the register to read, modify, write |
aAddend | the addend to add to the existing value in the target register |
Implements uhal::ClientInterface.
Definition at line 55 of file DummyClient.cpp.
|
privatevirtual |
Write a single, unmasked word to a register.
aAddr | the address of the register to write |
aValue | the value to write to the register |
Implements uhal::ClientInterface.
Definition at line 30 of file DummyClient.cpp.
|
privatevirtual |
Write a block of data to a block of registers or a block-write port.
aAddr | the address of the register to write |
aValues | the values to write to the registers or a block-write port |
aMode | whether we are writing to a block of registers (INCREMENTAL) or a block-write port (NON_INCREMENTAL) |
Implements uhal::ClientInterface.
Definition at line 35 of file DummyClient.cpp.
|
privatevirtual |
Function which the dispatch calls when the reply is received to check that the headers are as expected.
aSendBufferStart | a pointer to the start of the first word of IPbus data which was sent (i.e. with no preamble) |
aSendBufferEnd | a pointer to the end of the last word of IPbus data which was sent |
aReplyStartIt | an iterator to the start of the list of memory locations in to which the reply was written |
aReplyEndIt | an iterator to the end (one past last valid entry) of the list of memory locations in to which the reply was written |
Implements uhal::ClientInterface.
Definition at line 60 of file DummyClient.cpp.