#include <buffer.h>
Public Member Functions | |
| Buffer () | |
| Construct a new, empty buffer. | |
| ~Buffer () | |
| Destruct the buffer. | |
| void | clear () |
| Flush the buffer, deleting all _data. | |
| Buffer (Buffer &from) | |
| Copy constructor, transfers ownership to new Buffer. | |
| const Buffer & | operator= (Buffer &from) |
| Assignment operator, copies _data from Buffer. | |
| T & | operator[] (const size_t position) |
| Direct access to the element at the given index. | |
| const T & | operator[] (const size_t position) const |
| Direct const access to the element at the given index. | |
| void | resize (const uint64_t newSize) |
| Ensure that the buffer contains at least newSize elements, retaining existing _data. | |
| void | reserve (const uint64_t newSize) |
| Ensure that the buffer contains at least newSize elements, potentially deleting existing _data. | |
| void | append (const T *addData, const uint64_t addSize) |
| Append addSize elements to the buffer, increasing the _size. | |
| void | append (const T &element) |
| Append one element to the buffer, increasing the _size. | |
| void | replace (const void *newData, const uint64_t newSize) |
| Replace the existing _data with new _data. | |
| void | swap (Buffer &buffer) |
| Swap the buffer contents with another Buffer. | |
| T * | getData () |
| const T * | getData () const |
| bool | setSize (const uint64_t size) |
| Set the size of the buffer without changing its allocation. | |
| uint64_t | getSize () const |
| bool | isEmpty () const |
| uint64_t | getMaxSize () const |
For bigger data (>100k) using a std::vector< uint8_t > has a high overhead when resizing (>1ms). This buffer just memcpy's elements, i.e., it should be used on PODs only since the copy constructor or assignment operator is not called on the copied elements. Primarily used for binary data, e.g., in eq::Image.
Definition at line 38 of file buffer.h.
| eq::base::Buffer< T >::Buffer | ( | ) | [inline] |
| eq::base::Buffer< T >::~Buffer | ( | ) | [inline] |
| eq::base::Buffer< T >::Buffer | ( | Buffer< T > & | from | ) | [inline] |
| void eq::base::Buffer< T >::clear | ( | ) | [inline] |
Flush the buffer, deleting all _data.
Definition at line 48 of file buffer.h.
Referenced by eq::base::Buffer< pollfd >::~Buffer().

| const Buffer& eq::base::Buffer< T >::operator= | ( | Buffer< T > & | from | ) | [inline] |
| T& eq::base::Buffer< T >::operator[] | ( | const size_t | position | ) | [inline] |
| const T& eq::base::Buffer< T >::operator[] | ( | const size_t | position | ) | const [inline] |
| void eq::base::Buffer< T >::append | ( | const T * | addData, | |
| const uint64_t | addSize | |||
| ) | [inline] |
Append addSize elements to the buffer, increasing the _size.
Definition at line 108 of file buffer.h.
Referenced by eq::net::DataOStream::write(), eq::net::BufferConnection::write(), and eq::net::DataOStream::writeOnce().

| void eq::base::Buffer< T >::append | ( | const T & | element | ) | [inline] |
| void eq::base::Buffer< T >::replace | ( | const void * | newData, | |
| const uint64_t | newSize | |||
| ) | [inline] |
Replace the existing _data with new _data.
Definition at line 126 of file buffer.h.
Referenced by eq::base::Buffer< pollfd >::operator=().

| void eq::base::Buffer< T >::swap | ( | Buffer< T > & | buffer | ) | [inline] |
| T* eq::base::Buffer< T >::getData | ( | ) | [inline] |
Definition at line 153 of file buffer.h.
Referenced by eq::net::FullMasterCM::addSlave(), eq::net::DataOStream::disable(), EqCompressorGetResult(), eq::net::DataOStream::flush(), eq::net::DataOStream::resend(), and eq::net::ConnectionSet::select().

| const T* eq::base::Buffer< T >::getData | ( | ) | const [inline] |
| bool eq::base::Buffer< T >::setSize | ( | const uint64_t | size | ) | [inline] |
| uint64_t eq::base::Buffer< T >::getSize | ( | ) | const [inline] |
Definition at line 176 of file buffer.h.
Referenced by eq::net::FullMasterCM::addSlave(), eq::net::DataOStream::disable(), eq::net::DataOStream::disableSave(), eq::net::DataOStream::enableSave(), EqCompressorGetResult(), eq::net::DataOStream::flush(), eq::net::DataOStream::resend(), eq::net::ConnectionSet::select(), and eq::net::DataOStream::write().

| bool eq::base::Buffer< T >::isEmpty | ( | ) | const [inline] |
| uint64_t eq::base::Buffer< T >::getMaxSize | ( | ) | const [inline] |
Definition at line 182 of file buffer.h.
Referenced by EqCompressorGetResult().

0.9 by
1.5.8