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

Send Window.

#include <sendwindow.hpp>

Public Member Functions

 SendWindow (Connection const &connection, T *buffer, size_type const count)
 Window for data to send to target. More...
 
 SendWindow (Connection const &connection, size_type const count)
 Window for data to send to target. More...
 
void init ()
 Initialize a send routine. More...
 
void post ()
 Post previously initialized send routine. More...
 
void post (size_type const sizeByte)
 Post previously initialized send routine, but only send first sizeByte bytes. More...
 
void wait ()
 Wait for previously posted send routine to finish. More...
 
template<class Iterator >
void insert (Iterator inputIt, size_type const offset, size_type const count)
 Copy data to internal buffer. More...
 
template<class Iterator >
void insert (Iterator inputIt)
 Copy data to internal buffer. More...
 
template<class Iterator >
void insertMT (Iterator inputIt, size_type const offset, size_type const count, int const threadID, int const threadCount)
 Multithreaded copy data to internal buffer. More...
 
template<class Iterator >
void insertMT (Iterator inputIt, int const threadID, int const threadCount)
 Multithreaded copy data to 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

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

Creates a SendWindow for specified connection. Sends count elements T, stored in contigious memory region buffer points to, to target.

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

Creates a SendWindow for specified connection. Sends count elements T, stored in internal buffer, to target.

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

Member Function Documentation

void init ( )
Note
Send buffer associated with this send window may still be accessed - read and write.
Warning
Any outstanding synchronization or previously initiated send routine, associated with the same connection, has to be finished before initializing a send routine.
Note
Receive and send routines associated with the same connection may be initialized simultaneously.
void insert ( Iterator  inputIt,
size_type const  offset,
size_type const  count 
)

Copies data from storage - inputIt iterator points to - to internal buffer starting at offset with bounds checking.

Parameters
inputItIterator to source.
offsetOffset for the internal buffer.
countNumber of elements to copy.
void insert ( Iterator  inputIt)

Fills the internal buffer - starting at the beginning - with data pointed to by inputIt.

Warning
The container inputIt points to must be at least of the same size as the internal buffer.
Parameters
inputItIterator to source.
void insertMT ( Iterator  inputIt,
size_type const  offset,
size_type const  count,
int const  threadID,
int const  threadCount 
)

Copies data from storage - inputIt iterator points to - to internal buffer starting at offset 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).
inputIt must be of type random access iterator.
Parameters
inputItIterator to source.
offsetOffset for the internal buffer.
countNumber of elements to copy.
threadIDID of the current Thread.
threadCountNumber of threads calling the function.
void insertMT ( Iterator  inputIt,
int const  threadID,
int const  threadCount 
)

Fills the internal buffer - starting at the beginning - with data pointed to by inputIt. The copy operation is shared among all threadCount threads calling the function.

Warning
The container inputIt 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).
inputIt must be of type random access iterator.
Parameters
inputItIterator to source.
threadIDID of the current Thread.
threadCountNumber of threads calling the function.
void post ( )
Warning
Send buffer associated with this send window may be accessed read only as soon as send routine has been posted.
Note
Depending on the used provider, this routine might be blocking.
void post ( size_type const  sizeByte)
Warning
Send buffer associated with this send window may be accessed read only as soon as send routine has been posted.
Note
Depending on the used provider, this routine might be blocking.
Parameters
sizeByteFirst sizeByte Bytes of SendWindow to send.
void wait ( )
Note
Write access to send buffer is allowed again after wait.
Blocking routine.