Buffer class
#include <robometry/Buffer.h>
A class to represent the buffer of robometry::
Public types
- using container_type = CircularBuffer<Record>
- Container aliases for clients that need to share the underlying storage.
-
using shared_buffer_type = std::shared_ptr<container_
type> -
using iterator = typename container_type::
iterator -
using const_iterator = typename container_type::
const_iterator
Constructors, destructors, conversion operators
- Buffer()
- Buffer(const Buffer& _other) defaulted
- Construct a new Buffer object copying from another Buffer.
- Buffer(Buffer&& _other) defaulted noexcept
- Construct a new Buffer object moving from another Buffer.
- ~Buffer() defaulted virtual
- Destroy the Buffer object.
- Buffer(size_t num_elements)
- Construct a new Buffer object.
Public functions
- auto operator=(const Buffer& _other) -> Buffer& defaulted
- Copy assignment operator.
- auto operator=(Buffer&& _other) -> Buffer& defaulted noexcept
- Move assignment operator.
- void push_back(const Record& elem)
- Push back copying the new Record.
- void push_back(Record&& elem)
- Push back moving the new Record.
- auto getBufferFreeSpace() const -> size_t
- Get the Buffer free space.
- auto size() const -> size_t
- Get the size of the Buffer.
- auto capacity() const -> size_t
- Get the capacity of Buffer.
- auto empty() const -> bool
- Return true if the Buffer is empty, false otherwise.
- void resize(size_t new_size)
- Resize the Buffer.
- void set_capacity(size_t new_size)
- Change the capacity of the Buffer.
- auto full() const -> bool
- Return true if the Buffer is full, false otherwise.
- auto begin() -> iterator noexcept
- Return the iterator referred to the begin of the Buffer.
- auto end() -> iterator noexcept
- Return the iterator referred to the end of the Buffer.
- auto begin() const -> const_iterator noexcept
- Return the const iterator referred to the begin of the Buffer.
- auto end() const -> const_iterator noexcept
- Return the const iterator referred to the end of the Buffer.
- void clear() noexcept
- Clear the content of the buffer.
- auto getBufferSharedPtr() const -> shared_buffer_type
- Get the Buffer shared_ptr object.
Function documentation
size_t robometry:: Buffer:: getBufferFreeSpace() const
Get the Buffer free space.
| Returns | size_t The number of records that can be inserted without overwriting. |
|---|
void robometry:: Buffer:: set_capacity(size_t new_size)
Change the capacity of the Buffer.
| Parameters | |
|---|---|
| new_size in | The new size. |
shared_buffer_type robometry:: Buffer:: getBufferSharedPtr() const
Get the Buffer shared_ptr object.
| Returns | shared_buffer_type Shared ownership of the underlying storage. |
|---|