![]() |
PEARL
Parallel Event Access and Replay Library
|
Generic memory buffer implementation. More...
#include <pearl/Buffer.h>
Public Member Functions | |
Constructors & destructor | |
Buffer (std::size_t capacity=512) | |
Buffer (const Buffer &rhs) | |
virtual | ~Buffer () |
Assignment operator | |
Buffer & | operator= (const Buffer &rhs) |
Accessing buffer properties | |
std::size_t | capacity () const |
std::size_t | size () const |
std::size_t | position () const |
Storing data values | |
void | put_id (const ident_t &id) |
void | putTimestamp (const timestamp_t ×tamp) |
void | put_uint8 (const uint8_t &value) |
void | put_uint32 (const uint32_t &value) |
void | put_int64 (const int64_t &value) |
void | put_uint64 (const uint64_t &value) |
void | put_double (const double &value) |
void | put_event (const Event &event) |
void | put_buffer (const Buffer &buffer) |
Retrieving data values | |
ident_t | get_id () |
timestamp_t | getTimestamp () |
uint8_t | get_uint8 () |
uint32_t | get_uint32 () |
uint64_t | get_uint64 () |
int64_t | get_int64 () |
double | get_double () |
RemoteEvent | get_event (const GlobalDefs &defs) |
Buffer * | get_buffer () |
Protected Member Functions | |
Internal buffer handling | |
void | reserve (std::size_t bytes) |
Protected Attributes | |
std::size_t | m_capacity |
Current buffer capacity. More... | |
std::size_t | m_size |
Current usage of buffer. More... | |
std::size_t | m_position |
Current read position. More... | |
uint8_t * | m_data |
Pointer to the actual data. More... | |
The Buffer class provides a generic implementation of a memory buffer which is able to adjust its size dynamically. It can be used, for example, to pass event data between several processes or threads. To allow its use in heterogeneous environments, this class transparently handles the problem of different byte orders.
pearl::Buffer::Buffer | ( | std::size_t | capacity = 512 | ) |
pearl::Buffer::Buffer | ( | const Buffer & | rhs | ) |
|
virtual |
std::size_t pearl::Buffer::capacity | ( | ) | const |
Buffer* pearl::Buffer::get_buffer | ( | ) |
double pearl::Buffer::get_double | ( | ) |
RemoteEvent pearl::Buffer::get_event | ( | const GlobalDefs & | defs | ) |
ident_t pearl::Buffer::get_id | ( | ) |
int64_t pearl::Buffer::get_int64 | ( | ) |
uint32_t pearl::Buffer::get_uint32 | ( | ) |
uint64_t pearl::Buffer::get_uint64 | ( | ) |
uint8_t pearl::Buffer::get_uint8 | ( | ) |
timestamp_t pearl::Buffer::getTimestamp | ( | ) |
std::size_t pearl::Buffer::position | ( | ) | const |
void pearl::Buffer::put_buffer | ( | const Buffer & | buffer | ) |
void pearl::Buffer::put_double | ( | const double & | value | ) |
void pearl::Buffer::put_event | ( | const Event & | event | ) |
void pearl::Buffer::put_id | ( | const ident_t & | id | ) |
void pearl::Buffer::put_int64 | ( | const int64_t & | value | ) |
void pearl::Buffer::put_uint32 | ( | const uint32_t & | value | ) |
void pearl::Buffer::put_uint64 | ( | const uint64_t & | value | ) |
void pearl::Buffer::put_uint8 | ( | const uint8_t & | value | ) |
void pearl::Buffer::putTimestamp | ( | const timestamp_t & | timestamp | ) |
|
protected |
std::size_t pearl::Buffer::size | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
![]() |
Copyright © 1998–2019 Forschungszentrum Jülich GmbH,
Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming |