|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
39 #ifndef _uhal_Buffers_hpp_
40 #define _uhal_Buffers_hpp_
64 Buffers (
const uint32_t& aMaxSendSize = 65536 );
86 template<
typename T >
87 uint8_t*
send (
const T* aPtr );
94 template<
typename T >
95 uint8_t*
send (
const T& aRef );
103 uint8_t*
send (
const uint8_t* aPtr ,
const uint32_t& aSize );
109 template<
typename T >
116 template<
typename T >
124 void receive ( uint8_t* aPtr ,
const uint32_t& aSize );
uint32_t mSendCounter
The number of bytes that are currently in the send buffer.
std::deque< ValWord< uint32_t > > mUnsignedValWords
Deque holding validated memories so that they are guaranteed to exist when the transaction is perform...
uint8_t * getSendBuffer()
Get a pointer to the start of the send buffer.
const uint32_t & replyCounter()
Get the number of bytes that are currently expected by the reply buffer.
const uint32_t & sendCounter()
Get the number of bytes that are currently in the send buffer.
std::deque< ValVector< uint32_t > > mUnsignedValVectors
Deque holding validated memories so that they are guaranteed to exist when the transaction is perform...
std::vector< uint8_t > mSendBuffer
The start location of the memory buffer.
uint32_t mReplyCounter
The number of bytes that are currently expected by the reply buffer.
std::deque< std::pair< uint8_t *, uint32_t > > mReplyBuffer
The queue of reply destinations.
void add(const ValHeader &aValMem)
Helper function to associate a validated memory with this buffer so that it is guaranteed to exist wh...
void receive(T *aPtr)
Helper function to add a destination object to the reply queue.
virtual ~Buffers()
Destructor.
void clear()
Clear the counters and the reply buffers.
A class wrapping the send and recieve buffers that are to be filled and transported and the validated...
std::deque< std::pair< uint8_t *, uint32_t > > & getReplyBuffer()
Get a reference to the reply queue.
Buffers(const uint32_t &aMaxSendSize=65536)
Constructor.
std::deque< ValHeader > mValHeaders
Deque holding validated memories so that they are guaranteed to exist when the transaction is perform...
void validate()
Helper function to mark all validated memories associated with this buffer as valid.
uint8_t * send(const T *aPtr)
Helper function to copy an object to the send buffer.