Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
bitpit::CommunicationBuffer< RawBufferType > Class Template Reference

Buffer to be used for data communications. More...

#include <communications_buffers.hpp>

Inheritance diagram for bitpit::CommunicationBuffer< RawBufferType >:
Inheritance graph
[legend]

Public Member Functions

 CommunicationBuffer (size_t size=0, bool doubleBuffer=false)
 
size_t getSize () const
 
bool isDouble () const
 
bool seekg (size_t pos)
 
void setSize (size_t size)
 
std::ifstream::pos_type tellg (void) const
 

Protected Member Functions

RawBufferType & getBack ()
 
std::vector< RawBufferType > & getBuffers ()
 
const std::vector< RawBufferType > & getBuffers () const
 
RawBufferType & getFront ()
 
void swap ()
 

Detailed Description

template<typename RawBufferType>
class bitpit::CommunicationBuffer< RawBufferType >

Buffer to be used for data communications.

Template Parameters
RawBufferTypeis the type of raw buffer that will be used

Definition at line 60 of file communications_buffers.hpp.

Constructor & Destructor Documentation

◆ CommunicationBuffer()

template<typename RawBufferType >
bitpit::CommunicationBuffer< RawBufferType >::CommunicationBuffer ( size_t size = 0,
bool doubleBuffer = false )

Create a new communication buffer

Definition at line 64 of file communications_buffers.tpp.

Member Function Documentation

◆ getBack()

template<typename RawBufferType >
RawBufferType & bitpit::CommunicationBuffer< RawBufferType >::getBack ( )
protected

Get the back buffer

Returns
The back buffer.

Definition at line 152 of file communications_buffers.tpp.

◆ getBuffers() [1/2]

template<typename RawBufferType >
std::vector< RawBufferType > & bitpit::CommunicationBuffer< RawBufferType >::getBuffers ( )
protected

Get a reference to the raw buffers

Definition at line 170 of file communications_buffers.tpp.

◆ getBuffers() [2/2]

template<typename RawBufferType >
const std::vector< RawBufferType > & bitpit::CommunicationBuffer< RawBufferType >::getBuffers ( ) const
protected

Get a constant reference to the raw buffers

Definition at line 179 of file communications_buffers.tpp.

◆ getFront()

template<typename RawBufferType >
RawBufferType & bitpit::CommunicationBuffer< RawBufferType >::getFront ( )
protected

Get the front buffer

Returns
The front buffer.

Definition at line 141 of file communications_buffers.tpp.

◆ getSize()

template<typename RawBufferType >
size_t bitpit::CommunicationBuffer< RawBufferType >::getSize ( ) const

Get the size of the buffer

Returns
The size of the buffer.

Definition at line 83 of file communications_buffers.tpp.

◆ isDouble()

template<typename RawBufferType >
bool bitpit::CommunicationBuffer< RawBufferType >::isDouble ( ) const

Checks if the buffer is a double buffer.

Returns
Returns true if the buffer is a double buffer, false otherwise.

Definition at line 130 of file communications_buffers.tpp.

◆ seekg()

template<typename RawBufferType >
bool bitpit::CommunicationBuffer< RawBufferType >::seekg ( size_t pos)

Set cursor position within the front buffer

Parameters
posis the new cursor position
Returns
Return true if new position is valid, false otherwise

Definition at line 108 of file communications_buffers.tpp.

◆ setSize()

template<typename RawBufferType >
void bitpit::CommunicationBuffer< RawBufferType >::setSize ( size_t size)

Set the size of the buffer

Parameters
sizeis the size of the buffer

Definition at line 94 of file communications_buffers.tpp.

◆ swap()

template<typename RawBufferType >
void bitpit::CommunicationBuffer< RawBufferType >::swap ( )
protected

Swap front and back buffers.

Definition at line 161 of file communications_buffers.tpp.

◆ tellg()

template<typename RawBufferType >
std::ifstream::pos_type bitpit::CommunicationBuffer< RawBufferType >::tellg ( void ) const

Get cursor position within the front buffer

Returns
Returns the cursor position.

Definition at line 119 of file communications_buffers.tpp.


The documentation for this class was generated from the following files:
--- layout: doxygen_footer ---