A queue of templatized objects that supports user-specified containers. More...
#include <rw/tqueue.h>
Public Member Functions | |
RWTQueue () | |
RWTQueue (const C &rhs) | |
RWTQueue (const RWTQueue &rhs) | |
RWTQueue (C &&rhs) | |
RWTQueue (RWTQueue &&rhs) | |
void | clear () |
size_t | entries () const |
T | first () const |
T | get () |
void | insert (const T &a) |
void | insert (T &&a) |
bool | isEmpty () const |
T | last () const |
RWTQueue & | operator= (const RWTQueue &rhs) |
RWTQueue & | operator= (RWTQueue &&rhs) |
void | swap (RWTQueue< T, C > &rhs) |
Class RWTQueue represents a parameterized queue. Not only can the type of object inserted into the queue be parameterized, but also the implementation.
Parameter T
represents the type of object in the queue, either a class or built-in type. The class T
must have:
T::T(const T&)
or equivalent)T::operator=(const T&)
or equivalent)C
.Parameter C
represents the class used for implementation. The class C
must provide the following interface (or equivalent):
void C::append(const T&)
void C::clear()
size_t C::entries() const
T C::first()
bool C::isEmpty() const
T C::last()
T C::removeFirst()
C::C()
)C::C(const C&)
)C& C::operator=(const C&)
)These methods must behave in a manner that is consistent with that of RWTValDlist for this class to function as intended.
Useful choices for C
are RWTValSlist or RWTValDlist. Vectors, such as RWTValOrderedVector, can also be used, but tend to be less efficient at removing an object from the front of the queue.
Constructs a queue from the container rhs.
Copy constructor. Constructs self as a copy of rhs.
Move constructor. Takes ownership of the data owned by rhs.
Move constructor. Takes ownership of the data owned by rhs.
|
inline |
Calls C::clear()
on the underlying container.
|
inline |
Returns the result of calling C::entries()
on the underlying container.
|
inline |
Returns the result of calling C::first()
on the underlying container.
|
inline |
Returns the result of calling C::removeFirst()
on the underlying container.
|
inline |
Calls C::append(a)
on the underlying container.
|
inline |
Calls C::append(a)
on the underlying container.
|
inline |
Returns the result of calling C::isEmpty()
on the underlying container.
|
inline |
Returns the result of calling C::last()
on the underlying container.
|
inline |
Assignment operator. Sets self to a copy of rhs.
Move assignment. Takes ownership of the data owned by rhs.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |