Public Types |
typedef std::vector
< boost::optional< T > > | Buffer |
| The type of the internal buffer.
|
typedef Buffer::size_type | size_type |
| Shorthand to vector size type.
|
Public Member Functions |
boost::optional< T > | at (const std::size_t pos) const |
| Read-only access to a specific buffer element.
|
const Buffer & | buffer () const |
| Read-only access to the buffer.
|
boost::optional< T > | operator[] (const std::size_t pos) const |
| Read-only access to a specific buffer element.
|
void | reset () |
| Empties the Z buffer.
|
const size_type | size () const |
| Returns the buffer size.
|
bool | update (const std::size_t pos, const T &value) |
| ZBuffer (const std::size_t size, const TCompare &cmp=TCompare()) |
Private Attributes |
Buffer | m_buffer |
| The actual buffer (a vector with optionally empty elements).
|
TCompare | m_cmp |
| The comparison operator.
|
template<typename T, typename TCompare = std::less<T>>
class icl_core::ZBuffer< T, TCompare >
A simple Z buffer implementation. Values are stored inside the buffer only if their corresponding buffer cell is currently empty, or the values are less than the currently stored value (where the meaning of "less" can be defined by a custom operator).
- Template Parameters:
-
T | The stored type. Elements of the buffer will be of type boost::optional<T>. |
TCompare | Comparison operator. A stored element is updated with a new element if the comparison m_cmp(new_elem, current_elem) returns true . |
Definition at line 43 of file ZBuffer.h.