SourcePro C++ 13.0 |
SourcePro® C++ API Reference Guide |
Product Documentation: SourcePro C++ Documentation Home |
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) | |
More... | |
void | clear () |
size_t | entries () const |
T | first () const |
T | get () |
void | insert (const T &a) |
void | insert (T &&a) |
More... | |
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<T,A> for this class to function as intended.
Useful choices for C
are RWTValSlist<T,A> or RWTValDlist<T,A>. Vectors, such as RWTValOrderedVector<T,A>, can also be used, but tend to be less efficient at removing an object from the front of the queue.
None
Program output
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 © 2014 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.