diff --git a/Buffer.html b/Buffer.html new file mode 100644 index 0000000..f869afc --- /dev/null +++ b/Buffer.html @@ -0,0 +1,85 @@ + + + + + Buffer Concept + + +

C++ Boost
Buffer Concept

+

A Buffer is something in which items can be put and removed. The Buffer concept has very few requirements. It does not require any particular ordering of how the items are stored or in what order they will appear when removed, however, there is typically some sort of ordering policy.

+ +

Notation

+ + +

Members

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MemberDescription
value_typeThe type of object stored in the Buffer. The value type must be Assignable.
size_typeAn unsigned integral type for representing the number of objects in the Buffer.
void push(const T& t)Inserts t into the Buffer. size() will be incremented by one.
void pop()Removes an object from the Buffer. size() will be decremented by one. Precondition: empty() is false.
T& top()Returns a mutable reference to some object in the Buffer. Precondition: empty() is false.
const T& top() constReturns a const reference to some object in the Buffer. Precondition: empty() is false.
void size() constReturns the number of objects in the Buffer. Invariant: size() >= 0.
bool empty() constEquivalent to b.size() == 0.
+ +

Complexity Guarantees

+ + +

Models

+ + +
+ + + + + +
Copyright © 2004Jeremy 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

+ + + diff --git a/UpdatableBuffer.html b/UpdatableBuffer.html new file mode 100644 index 0000000..99c8779 --- /dev/null +++ b/UpdatableBuffer.html @@ -0,0 +1,96 @@ + + + + + Updatable Buffer Concept + + +

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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MemberWhere DefinedDescription
value_typeBufferThe type of object stored in the Buffer. The value type must be Assignable.
size_typeBufferAn unsigned integral type for representing the number of objects in the Buffer.
void update(const T& t)UpdatableBufferRevalidates 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)BufferInserts t into the Buffer. size() will be incremented by one.
void pop()BufferRemoves an object from the Buffer. size() will be decremented by one.
Precondition: empty() is false.
T& top()BufferReturns a mutable reference to some object in the Buffer. Precondition: empty() is false.
const T& top() constBufferReturns a const reference to some object in the Buffer. Precondition: empty() is false.
void size() constBufferReturns the number of objects in the Buffer. Invariant: size() >= 0.
bool empty() constBufferEquivalent to b.size() == 0.
+ +

Complexity Guarantees

+ + +

Models

+ + +
+ + + + + +
Copyright © 2004Jeremy 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

+ + + diff --git a/queue.html b/queue.html new file mode 100644 index 0000000..9803b6c --- /dev/null +++ b/queue.html @@ -0,0 +1,180 @@ + + + + + queue + + +

C++ Boost
queue

+

A boost::queue is a container adaptor that provides both std::queue and Buffer functionality.

+ +

Where Defined

+

boost/queue.hpp

+ +

Template Parameters

+ + + + + + + + + + + + + + + + +
ParameterDescriptionDefault
TThe type of object stored in the queue.
SequenceThe type of the underlying container used to implement the queue.std::deque<T>
+ +

Models

+ + +

Type Requirements

+ + +

Public Base Classes

+

None.

+ +

Members

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MemberWhere DefinedDescription
value_typeBufferThe type of object stored in the queue. This is the same as T and Sequence::value_type.
size_typeBufferAn unsigned integral type. This is the same as Sequence::size_type.
queue()Default ConstructibleThe default constructor. Creates an empty queue.
queue(const Sequence& c)boost::queueThe constructor. Creates a queue initialized to contain the elements in c, in back-insertion order.
bool empty() constBufferReturns true if the queue contains no elements, and false otherwise. empty() is equivalent to size() == 0.
size_type size() constBufferReturns the number of elements contained in the queue.
value_type& top()BufferReturns a mutable reference to the least recently inserted element in the queue. Precondition: empty() is false.
value_type& front()std::queueServes the same function as value_type& top().
const value_type& top() constBufferReturns a const reference to the least recently inserted element in the queue. Precondition: empty() is false.
const value_type& front() constboost::queue, not std::queueServes the same function as const value_type& top() const.
void push(const value_type& x)BufferInserts x into the queue. Postcondition: size() will be incremented by 1.
void pop()BufferRemoves the least recently inserted element from the queue. Postcondition: size() will be decremented by 1.
bool operator==(const queue&, const queue&)boost::queueCompares two queues for equality. Two queues are equal if they contain the same number of elements and if they are equal element-by-element. This is a global function, not a member function.
bool operator<(const queue&, const queue&)boost::queueLexicographical ordering of two queues. This is a global function, not a member function.
+ +

Complexity

+ + +

Example

+
#include <boost/queue>
+#include <cassert>
+
+int main()
+{
+  boost::queue<int> Q;
+
+  Q.push(8);
+  Q.push(7);
+  Q.push(6);
+  Q.push(2);
+  
+  assert(Q.size() == 4);
+  assert(Q.top() == 8);
+  Q.pop();
+
+  assert(Q.top() == 7);
+  Q.pop();
+
+  assert(Q.top() == 6);
+  Q.pop();
+  
+  assert(Q.top() == 2);
+  Q.pop();
+
+  assert(Q.empty());
+
+  return 0;
+}
+
+ +
+ + + + + +
Copyright © 2004Jeremy 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

+ + +