CXXR (C++ R)
Classes | Public Member Functions
CXXR::HeterogeneousList< Node > Class Template Reference

Doubly-linked list of objects derived from a class Node. More...

#include <HeterogeneousList.hpp>

Inheritance diagram for CXXR::HeterogeneousList< Node >:
Inheritance graph
[legend]
Collaboration diagram for CXXR::HeterogeneousList< Node >:
Collaboration graph
[legend]

List of all members.

Classes

class  const_iterator
 const_iterator for iterating over a HeterogeneousList. More...

Public Member Functions

Node * back ()
 Last element of list.
const Node * back () const
 Last element of list (const variant).
const_iterator begin () const
const_iterator end () const
Node * front ()
 First element of list.
const Node * front () const
 First element of list (const variant).
void splice_back (const Node *node)
 Move node to the end of this list.
void splice_back (HeterogeneousList< Node > *other)
 Move contents of another list to the back of this list.
- Public Member Functions inherited from CXXR::HeterogeneousListBase
 HeterogeneousListBase ()
 Create an empty list.
 ~HeterogeneousListBase ()
 Destructor.
void clear ()
 Delete all the objects on the list, leaving an empty list.
bool empty () const
 Is the list empty?
void freeLinks ()
 Convert all objects on the list to free Links.

Additional Inherited Members

- Static Protected Member Functions inherited from CXXR::HeterogeneousListBase
static Linkpredecessor (Link *link)
 Get link preceding a specified link.
static Linksuccessor (Link *link)
 Get link following a specified link.

Detailed Description

template<class Node>
class CXXR::HeterogeneousList< Node >

Doubly-linked list of objects derived from a class Node.

Template Parameters:
NodeBase class for object on the list. Node must itself be derived from HeterogeneousListBase::Link.

Member Function Documentation

template<class Node>
Node* CXXR::HeterogeneousList< Node >::back ( )
inline

Last element of list.

Returns:
A pointer to the last Node on the list. Effect undefined if the list is empty.
template<class Node>
const Node* CXXR::HeterogeneousList< Node >::back ( ) const
inline

Last element of list (const variant).

Returns:
A pointer to the last Node on the list. Effect undefined if the list is empty.
template<class Node>
Node* CXXR::HeterogeneousList< Node >::front ( )
inline

First element of list.

Returns:
A pointer to the first Node on the list. Effect undefined if the list is empty.
template<class Node>
const Node* CXXR::HeterogeneousList< Node >::front ( ) const
inline

First element of list (const variant).

Returns:
A const pointer to the first Node on the list. Effect undefined if the list is empty.
template<class Node>
void CXXR::HeterogeneousList< Node >::splice_back ( const Node *  node)
inline

Move node to the end of this list.

Parameters:
nodePointer to the node to be moved. The node may currently be on this list or another list, or be a free Link.
template<class Node>
void CXXR::HeterogeneousList< Node >::splice_back ( HeterogeneousList< Node > *  other)
inline

Move contents of another list to the back of this list.

Parameters:
otherPointer to the list whose contents are to be moved. The nodes of other are transferred, preserving their order, to the back of this list, leaving other as an empty list. It is permissible for other to point to this list itself, in which case the function is a no-op.

The documentation for this class was generated from the following file: