C++ Boost
Updatable Buffer Concept

An UpdatableBuffer is a special type of Buffer that provides an update operation for when the Buffer's ordering policy changes.

Notation

Members

For a type to model the UpdatableBuffer concept it must have the following members.

Member Where Defined Description
value_type Buffer The type of object stored in the Buffer. The value type must be Assignable.
size_type Buffer An unsigned integral type for representing the number of objects in the Buffer.
void update(const T& t) UpdatableBuffer Revalidates this Updatable Buffer. An Updatable Buffer is invalidated if its ordering policy changes with respect to t but its internal structure does not reflect that change.
Precondition: t is in the buffer.
void push(const T& t) Buffer Inserts t into the Buffer. size() will be incremented by one.
void pop() Buffer Removes an object from the Buffer. size() will be decremented by one.
Precondition: empty() is false.
T& top() Buffer Returns a mutable reference to some object in the Buffer. Precondition: empty() is false.
const T& top() const Buffer Returns a const reference to some object in the Buffer. Precondition: empty() is false.
void size() const Buffer Returns the number of objects in the Buffer. Invariant: size() >= 0.
bool empty() const Buffer Equivalent to b.size() == 0.

Complexity Guarantees

Models


Copyright © 2004 Jeremy Siek, Univ. of Notre Dame (jsiek@lsc.nd.edu)

Use, modification, and distribution are subject to the Boost Software License, Version 1.0 at http://www.boost.org/LICENSE_1_0.txt