μHAL (v2.7.9)
Part of the IPbus software repository
DummyClient.cpp
Go to the documentation of this file.
1 
3 
4 
5 #include "uhal/ClientFactory.hpp"
6 
7 
8 namespace uhal {
9 namespace tests {
10 
11 
12 DummyClient::DummyClient ( const std::string& aId, const URI& aUri ) :
13  ClientInterface ( aId, aUri, boost::posix_time::seconds ( 1 ) )
14 {
15 }
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
27  return ValHeader();
28 }
29 
30 ValHeader DummyClient::implementWrite ( const uint32_t& aAddr, const uint32_t& aValue )
31 {
32  return ValHeader();
33 }
34 
35 ValHeader DummyClient::implementWriteBlock ( const uint32_t& aAddr, const std::vector< uint32_t >& aValues, const defs::BlockReadWriteMode& aMode )
36 {
37  return ValHeader();
38 }
39 
40 ValWord< uint32_t > DummyClient::implementRead ( const uint32_t& aAddr, const uint32_t& aMask )
41 {
42  return ValWord<uint32_t>();
43 }
44 
45 ValVector< uint32_t > DummyClient::implementReadBlock ( const uint32_t& aAddr, const uint32_t& aSize, const defs::BlockReadWriteMode& aMode )
46 {
47  return ValVector< uint32_t >();
48 }
49 
50 ValWord< uint32_t > DummyClient::implementRMWbits ( const uint32_t& aAddr , const uint32_t& aANDterm , const uint32_t& aORterm )
51 {
52  return ValWord<uint32_t>();
53 }
54 
55 ValWord< uint32_t > DummyClient::implementRMWsum ( const uint32_t& aAddr , const int32_t& aAddend )
56 {
57  return ValWord<uint32_t>();
58 }
59 
60 exception::exception* DummyClient::validate ( uint8_t* aSendBufferStart ,
61  uint8_t* aSendBufferEnd ,
62  std::deque< std::pair< uint8_t* , uint32_t > >::iterator aReplyStartIt ,
63  std::deque< std::pair< uint8_t* , uint32_t > >::iterator aReplyEndIt )
64 {
65  return NULL;
66 }
67 
69 {
70  return 0;
71 }
72 
74 {
75  return 0;
76 }
77 
79 {
80  return 0;
81 }
82 
83 UHAL_REGISTER_EXTERNAL_CLIENT(uhal::tests::DummyClient, "__test__", "A dummy client description")
84 
85 }
86 }
87 
DummyClient.hpp
uhal::ValVector< uint32_t >
uhal::tests::DummyClient::implementWriteBlock
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.
Definition: DummyClient.cpp:35
boost::shared_ptr
Definition: DerivedNodeFactory.hpp:52
uhal::ClientInterface
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
Definition: ClientInterface.hpp:100
uhal::tests::DummyClient::implementReadBlock
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.
Definition: DummyClient.cpp:45
boost
Definition: log.hpp:13
uhal::tests::DummyClient
Empty client class, written to test registration.
Definition: DummyClient.hpp:13
uhal::tests::DummyClient::implementRMWbits
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 val...
Definition: DummyClient.cpp:50
uhal::exception::exception
An abstract base exception class, including an interface to throw as the derived type (for passing ex...
Definition: exception.hpp:71
uhal::ValHeader
A class which wraps a single word of data and marks whether or not it is valid.
Definition: ValMem.hpp:148
uhal
Definition: HttpResponseGrammar.hpp:49
UHAL_REGISTER_EXTERNAL_CLIENT
#define UHAL_REGISTER_EXTERNAL_CLIENT(clientclass, clienturi, clientdescription)
Definition: ClientFactory.hpp:203
uhal::tests::DummyClient::getMaxReplySize
uint32_t getMaxReplySize()
Return the maximum size of reply packet based on the buffer size in the target.
Definition: DummyClient.cpp:78
uhal::defs::BlockReadWriteMode
BlockReadWriteMode
define whether transactions target a single register, a block of registers, a block-read/write port o...
Definition: definitions.hpp:53
uhal::tests::DummyClient::DummyClient
DummyClient(const std::string &aId, const URI &aUri)
Definition: DummyClient.cpp:12
uhal::tests::DummyClient::implementRead
ValWord< uint32_t > implementRead(const uint32_t &aAddr, const uint32_t &aMask)
Read a single, masked, unsigned word.
Definition: DummyClient.cpp:40
uhal::tests::DummyClient::implementDispatch
void implementDispatch(boost::shared_ptr< Buffers > aBuffers)
Pure virtual function which actually performs the dispatch operation.
Definition: DummyClient.cpp:21
uhal::tests::DummyClient::getMaxNumberOfBuffers
uint32_t getMaxNumberOfBuffers()
Return the maximum number of packets in flight.
Definition: DummyClient.cpp:68
uhal::tests::DummyClient::validate
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 expecte...
Definition: DummyClient.cpp:60
uhal::tests::DummyClient::implementWrite
ValHeader implementWrite(const uint32_t &aAddr, const uint32_t &aValue)
Write a single, unmasked word to a register.
Definition: DummyClient.cpp:30
uhal::ValWord< uint32_t >
uhal::tests::DummyClient::getMaxSendSize
uint32_t getMaxSendSize()
Return the maximum size to be sent based on the buffer size in the target.
Definition: DummyClient.cpp:73
uhal::tests::DummyClient::implementBOT
ValHeader implementBOT()
Send a byte order transaction.
Definition: DummyClient.cpp:25
uhal::tests::DummyClient::implementRMWsum
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...
Definition: DummyClient.cpp:55
uhal::URI
Struct to store a URI when parsed by boost spirit.
Definition: URI.hpp:50
uhal::tests::DummyClient::~DummyClient
~DummyClient()
Definition: DummyClient.cpp:17
ClientFactory.hpp