PSCF v1.1
Public Member Functions | List of all members
Util::Node< Data > Class Template Reference

Linked List Node, class template. More...

#include <Node.h>

Public Member Functions

 Node ()
 Default constructor. More...
 
 Node (Node< Data > const &other)
 Copy constructor. More...
 
Node< Data > * next () const
 Get the next pointer. More...
 
Node< Data > * prev () const
 Get the previous pointer. More...
 
Data const & data () const
 Get a const reference to the associated Data. More...
 
Data & data ()
 Get a reference to the associated Data object. More...
 
List< Data > & list () const
 Get a reference to the List. More...
 
void setNext (Node< Data > *next)
 Set pointer to the next Node. More...
 
void setPrev (Node< Data > *prev)
 Set pointer to the previous Node. More...
 
void setList (List< Data > &list)
 Set the list. More...
 
void setList (List< Data > *list)
 Set the list. More...
 
void attachNext (Node< Data > &other)
 Set pointers connecting the other node after this node. More...
 
void attachPrev (Node< Data > &other)
 Set pointers connecting the other node before this node. More...
 
void clear ()
 Nullify previous and next pointers, and nullify the list pointer. More...
 

Detailed Description

template<typename Data>
class Util::Node< Data >

Linked List Node, class template.

Definition at line 22 of file Node.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

template<typename Data >
Util::Node< Data >::Node ( )
inline

Default constructor.

Definition at line 30 of file Node.h.

◆ Node() [2/2]

template<typename Data >
Util::Node< Data >::Node ( Node< Data > const &  other)
inline

Copy constructor.

Definition at line 40 of file Node.h.

Member Function Documentation

◆ next()

template<typename Data >
Node< Data > * Util::Node< Data >::next ( ) const
inline

◆ prev()

template<typename Data >
Node< Data > * Util::Node< Data >::prev ( ) const
inline

◆ data() [1/2]

template<typename Data >
Data const & Util::Node< Data >::data ( ) const
inline

Get a const reference to the associated Data.

Returns
Data object associated with this Node.

Definition at line 68 of file Node.h.

Referenced by pscfpp.field.Field::__init__(), pscfpp.field.Field::__str__(), pscfpp.field.Field::addColumn(), pscfpp.field.Field::deleteColumn(), pscfpp.field.Field::read(), and pscfpp.field.Field::reorder().

◆ data() [2/2]

template<typename Data >
Data & Util::Node< Data >::data ( )
inline

Get a reference to the associated Data object.

Returns
Data object associated with this Node.

Definition at line 76 of file Node.h.

Referenced by pscfpp.field.Field::__init__(), pscfpp.field.Field::__str__(), pscfpp.field.Field::addColumn(), pscfpp.field.Field::deleteColumn(), pscfpp.field.Field::read(), and pscfpp.field.Field::reorder().

◆ list()

template<typename Data >
List< Data > & Util::Node< Data >::list ( ) const
inline

Get a reference to the List.

Returns
Reference to the list to which this Node belongs.

Definition at line 84 of file Node.h.

Referenced by Util::List< Data >::insert(), Util::List< Data >::isValid(), Util::List< Data >::remove(), and Util::Node< Data >::setList().

◆ setNext()

template<typename Data >
void Util::Node< Data >::setNext ( Node< Data > *  next)
inline

Set pointer to the next Node.

Parameters
nextpointer to next Node

Definition at line 92 of file Node.h.

References Util::Node< Data >::next().

Referenced by Util::List< Data >::insert(), Util::List< Data >::insertNext(), and Util::List< Data >::pushBack().

◆ setPrev()

template<typename Data >
void Util::Node< Data >::setPrev ( Node< Data > *  prev)
inline

Set pointer to the previous Node.

Parameters
prevpointer to previous Node

Definition at line 100 of file Node.h.

References Util::Node< Data >::prev().

Referenced by Util::List< Data >::insert(), Util::List< Data >::insertPrev(), and Util::List< Data >::pushFront().

◆ setList() [1/2]

template<typename Data >
void Util::Node< Data >::setList ( List< Data > &  list)
inline

Set the list.

Parameters
listassociated List object

Definition at line 108 of file Node.h.

References Util::Node< Data >::list().

Referenced by Util::List< Data >::insert(), Util::List< Data >::pushBack(), and Util::List< Data >::pushFront().

◆ setList() [2/2]

template<typename Data >
void Util::Node< Data >::setList ( List< Data > *  list)
inline

Set the list.

Parameters
listpointer to an associated List object

Definition at line 116 of file Node.h.

References Util::Node< Data >::list().

◆ attachNext()

template<typename Data >
void Util::Node< Data >::attachNext ( Node< Data > &  other)
inline

Set pointers connecting the other node after this node.

This method sets the next pointer of this node to other and the previous node of other to this. It also also sets the list of the other node to this list.

It does not reset the next pointer of the other node, and so does not finish splicing the other node into the middle of this list. The next pointer of the other node is left unchanged.

Parameters
othera Node to connect to this one.

Definition at line 132 of file Node.h.

Referenced by Util::List< Data >::insert(), Util::List< Data >::insertNext(), and Util::List< Data >::pushBack().

◆ attachPrev()

template<typename Data >
void Util::Node< Data >::attachPrev ( Node< Data > &  other)
inline

Set pointers connecting the other node before this node.

This method sets the previous pointer of this node to other and the next node of other to this. It also also sets the list of the other node to this list.

It does not reset the previous pointer of the other node, and so does not finish splicing the other node into the middle of this list. The previous pointer of the other node is left unchanged.

Parameters
othera Node to connect to this one.

Definition at line 152 of file Node.h.

Referenced by Util::List< Data >::insertPrev(), and Util::List< Data >::pushFront().

◆ clear()

template<typename Data >
void Util::Node< Data >::clear ( )
inline

Nullify previous and next pointers, and nullify the list pointer.

This method disconnects the Node from any List, but does not modify the datum_.

Definition at line 165 of file Node.h.

Referenced by Util::List< Data >::popBack(), Util::List< Data >::popFront(), and Util::List< Data >::remove().


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