Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jbuffer< T, Q > Class Template Reference

Public Member Functions

 jbuffer (std::shared_ptr< InterfacePP::jlogger > &logger)
 
 jbuffer (int numbufs, std::shared_ptr< InterfacePP::jlogger > &logger)
 
 jbuffer (jbuffer &rhs, std::shared_ptr< InterfacePP::jlogger > &logger)
 
 jbuffer (const jbuffer &rhs, std::shared_ptr< InterfacePP::jlogger > &logger)
 
 ~jbuffer ()
 standard destructor
 
void enqueue (uintptr_t bufptr)
 
std::pair< bool, uintptr_t > dequeue (uint32_t buffers, uintptr_t bufptr=0)
 
void write (uintptr_t bufptr, T *data, uint32_t length, uint32_t offset=0)
 
void write (uintptr_t bufptr, jarray< T > &data, uint32_t offset=0)
 
void write (uintptr_t bufptr, std::shared_ptr< jarray< T >> &data, uint32_t offset=0)
 
void read (uintptr_t bufptr, T *data, uint32_t length, uint32_t offset=0)
 
void read (uintptr_t bufptr, jarray< T > &data, uint32_t offset=0)
 
void read (uintptr_t bufptr, std::shared_ptr< jarray< T >> &data, uint32_t offset=0)
 

Constructor & Destructor Documentation

◆ jbuffer() [1/4]

template<typename T , std::size_t Q>
jbuffer::jbuffer ( std::shared_ptr< InterfacePP::jlogger > &  logger)
explicit

standard constructor for 16k buffers of size Q

Parameters
logger- logging object

◆ jbuffer() [2/4]

template<typename T , std::size_t Q>
jbuffer::jbuffer ( int  numbufs,
std::shared_ptr< InterfacePP::jlogger > &  logger 
)

constructor for number of buffers of size Q

Parameters
numbufs- number of buffers to create in memory
logger- logging object

◆ jbuffer() [3/4]

template<typename T , std::size_t Q>
jbuffer::jbuffer ( jbuffer< T, Q > &  rhs,
std::shared_ptr< InterfacePP::jlogger > &  logger 
)

copy constructor

Parameters
rhs- buffman to copy
logger- logging object

◆ jbuffer() [4/4]

template<typename T , std::size_t Q>
jbuffer::jbuffer ( const jbuffer< T, Q > &  rhs,
std::shared_ptr< InterfacePP::jlogger > &  logger 
)

const copy constructor

Parameters
rhs- CONST buffman to copy
logger- logging object

Member Function Documentation

◆ dequeue()

template<typename T , std::size_t Q>
std::pair< bool, uintptr_t > jbuffer::dequeue ( uint32_t  buffers,
uintptr_t  bufptr = 0 
)

allocates buffers from the memory

Parameters
buffers- number of buffers requested from memory
bufptr- if provided, add buffers to the link list pointed to by bufptr
Returns
- Pointer to beginning buffer
Here is the call graph for this function:

◆ enqueue()

template<typename T , std::size_t Q>
void jbuffer::enqueue ( uintptr_t  bufptr)

release buffers back to the memory

Parameters
bufptr- releases all buffers pointed to by bufptr after scrubbing and zeroizing
Here is the call graph for this function:

◆ read() [1/3]

template<typename T , std::size_t Q>
void jbuffer::read ( uintptr_t  bufptr,
jarray< T > &  data,
uint32_t  offset = 0 
)

read data from buffers at offset

Parameters
bufptr- pointer to the start of the buffers
data- pointer to hold output data
offset- offset into buffers to start reading
Here is the call graph for this function:

◆ read() [2/3]

template<typename T , std::size_t Q>
void jbuffer::read ( uintptr_t  bufptr,
std::shared_ptr< jarray< T >> &  data,
uint32_t  offset = 0 
)

read data from buffers at offset

Parameters
bufptr- pointer to the start of the buffers
data- pointer to hold output data
offset- offset into buffers to start reading

◆ read() [3/3]

template<typename T , std::size_t Q>
void jbuffer::read ( uintptr_t  bufptr,
T *  data,
uint32_t  length,
uint32_t  offset = 0 
)

read data from buffers at offset

Parameters
bufptr- pointer to the start of the buffers
data- pointer to hold output data
length- length of data to read
offset- offset into buffers to start reading

◆ write() [1/3]

template<typename T , std::size_t Q>
void jbuffer::write ( uintptr_t  bufptr,
jarray< T > &  data,
uint32_t  offset = 0 
)

write data to buffers at offset

Parameters
bufptr- pointer to the start of the buffers
data- data to write
offset- offset into buffers to start writing
Here is the call graph for this function:

◆ write() [2/3]

template<typename T , std::size_t Q>
void jbuffer::write ( uintptr_t  bufptr,
std::shared_ptr< jarray< T >> &  data,
uint32_t  offset = 0 
)

write data to buffers at offset

Parameters
bufptr- pointer to the start of the buffers
data- data to write
offset- offset into buffers to start writing

◆ write() [3/3]

template<typename T , std::size_t Q>
void jbuffer::write ( uintptr_t  bufptr,
T *  data,
uint32_t  length,
uint32_t  offset = 0 
)

write data to buffers at offset

Parameters
bufptr- pointer to the start of the buffers
data- data to write
length- length of data to write
offset- offset into buffers to start writing
Here is the call graph for this function:

The documentation for this class was generated from the following file: