pMR API Documentation
Public Member Functions | List of all members
RecvWindow< T > Class Template Reference

Receive Window.

#include <recvwindow.hpp>

Public Member Functions

 RecvWindow (Connection const &connection, T *buffer, size_type const count)
 Window to store data received from target. More...
 
 RecvWindow (Connection const &connection, size_type const count)
 Window to store data received from target. More...
 
void init ()
 Initialize a receive routine. More...
 
void post ()
 Post previously initialized receive routine. More...
 
void wait ()
 Wait for previously posted receive routine to finish. More...
 
template<class Iterator >
void extract (Iterator outputIt, size_type const offset, size_type const count)
 Copy data from internal buffer. More...
 
template<class Iterator >
void extract (Iterator outputIt)
 Copy data from internal buffer. More...
 
template<class Iterator >
void extractMT (Iterator outputIt, size_type const offset, size_type const count, int const threadID, int const threadCount)
 Multithreaded copy data from internal buffer. More...
 
template<class Iterator >
void extractMT (Iterator outputIt, int const threadID, int const threadCount)
 Multithreaded copy data from internal buffer. More...
 
- Public Member Functions inherited from Window< T >
T & operator[] (int const index)
 Direct access specified element of the internal buffer. More...
 
T const & operator[] (int const index) const
 Direct access specified element of the internal buffer. More...
 
T & at (int const index)
 Direct access specified element of the internal buffer with bounds checking. More...
 
T const & at (int const index) const
 Direct access specified element of the internal buffer with bounds checking. More...
 
T * begin ()
 Returns an iterator to the beginning of the internal buffer. More...
 
T const * begin () const
 Returns an iterator to const to the beginning of the internal buffer. More...
 
T const * cbegin () const
 Returns an iterator to const to the beginning of the internal buffer. More...
 
T * end ()
 Returns an Iterator to the end of the internal buffer. More...
 
T const * end () const
 Returns an Iterator to to const the end of the internal buffer. More...
 
T const * cend () const
 Returns an Iterator to const to the end of the internal buffer. More...
 
T * rbegin ()
 Returns a reverse iterator to the beginning of the internal buffer. More...
 
T const * rbegin () const
 Returns a reverse iterator to const to the beginning of the internal buffer. More...
 
T const * crbegin () const
 Returns a reverse iterator to const to the beginning of the internal buffer. More...
 
T * rend ()
 Returns a reverse Iterator to the end of the internal buffer. More...
 
T const * rend () const
 Returns a reverse Iterator to to const the end of the internal buffer. More...
 
T const * crend () const
 Returns a reverse Iterator to const to the end of the internal buffer. More...
 
size_type size () const
 Returns the number of elements in the internal buffer. More...
 
bool isSame (T *const buffer, size_type const count)
 Compare current Window with specified input data. More...
 
bool isSame (size_type const count)
 Compare current Window with specified input data. More...
 

Constructor & Destructor Documentation

RecvWindow ( Connection const &  connection,
T *  buffer,
size_type const  count 
)

Creates a RecvWindow for specified connection. Uses the contigious memory region - which can fit count elements of type T - buffer points to, to store data received from target.

Parameters
connectionConnection to associate Window with.
bufferPointer to memory region used as receive buffer.
countNumber of elements of type T in receive buffer.
RecvWindow ( Connection const &  connection,
size_type const  count 
)

Creates a RecvWindow for specified connection. Uses an internal buffer - which can fit count elements of type T - to store data received from target.

Parameters
connectionConnection to associate Window with.
countNumber of elements of type T in receive buffer.

Member Function Documentation

void extract ( Iterator  outputIt,
size_type const  offset,
size_type const  count 
)

Copies data from the internal buffer - starting at the specified offset - to the location specified by outputIt with bounds checking.

Parameters
outputItIterator to destination.
offsetOffset for the internal buffer.
countNumber of elements to copy.
void extract ( Iterator  outputIt)

Copies all elements - starting at the beginning - of the internal buffer to destination specified by outputIt.

Warning
The container outputIt points to must be at least of the same size as the internal buffer.
Parameters
outputItIterator to destination.
void extractMT ( Iterator  outputIt,
size_type const  offset,
size_type const  count,
int const  threadID,
int const  threadCount 
)

Copies data from the internal buffer - starting at the specified offset - to the location specified by outputIt with bounds checking. The copy operation is shared among all threadCount threads calling the function.

Warning
threadID has to be in range [0, threadCount).
The function has to be called with every threadID in the range [0, threadCount).
outputIt must be of type random access iterator.
Parameters
outputItIterator to destination.
offsetOffset for the internal buffer.
countNumber of elements to copy.
threadIDID of the current Thread.
threadCountNumber of threads calling the function.
void extractMT ( Iterator  outputIt,
int const  threadID,
int const  threadCount 
)

Copies all elements - starting at the beginning - of the internal buffer to destination specified by outputIt. The copy operation is shared among all threadCount threads calling the function.

Warning
The container outputIt points to must be at least of the same size as the internal buffer.
threadID has to be in range [0, threadCount).
The function has to be called with every threadID in the range [0, threadCount).
outputIt must be of type random access iterator.
Parameters
outputItIterator to data to be copied.
threadIDID of the current Thread.
threadCountNumber of threads calling the function.
void init ( )
Warning
Receive buffer associated with this receive window may not be accessed - read and write - as soon as the receive routine has been initialized.
Any outstanding synchronization or previously initiated receive routine, associated with the same connection, has to be finished before initializing a receive routine.
Note
Send and receive routines associated with the same connection may be initialized simultaneously.
void post ( )
Note
Depending on the used provider, this routine might be blocking.
void wait ( )
Note
Access to receive buffer is allowed again after wait.
Blocking routine.