libUTL++
utl::SlistNode Class Reference

Singly-linked list node. More...

#include <SlistNode.h>

Public Member Functions

 SlistNode ()
 Constructor.
 
 SlistNode (const Object *object)
 Constructor. More...
 
void addAfter (SlistNode *node)
 Add self after the given node. More...
 
void addBefore (SlistNode *node)
 Add self before the given node. More...
 
Objectget () const
 Get the contained object. More...
 
bool isTail () const
 Determine whether self is the tail node. More...
 
bool isSentinelTail () const
 Determine whether self is a "sentinal" tail node. More...
 
SlistNodenext () const
 Get the next node (= self if self is tail node). More...
 
void setNext (SlistNode *node)
 Set the next node. More...
 
SlistNoderemove (SlistNode *prev=nullptr)
 Remove self from the list. More...
 
void set (const Object *object)
 Set the contained object. More...
 

Detailed Description

Singly-linked list node.

Attributes

  • next : Next node (= nullptr if tail node).
Author
Adam McKee

Definition at line 26 of file SlistNode.h.

Constructor & Destructor Documentation

◆ SlistNode()

utl::SlistNode::SlistNode ( const Object object)
inline

Constructor.

Parameters
objectcontained object

Definition at line 41 of file SlistNode.h.

References utl::init().

Member Function Documentation

◆ addAfter()

void utl::SlistNode::addAfter ( SlistNode node)

Add self after the given node.

◆ addBefore()

void utl::SlistNode::addBefore ( SlistNode node)

Add self before the given node.

◆ get()

Object* utl::SlistNode::get ( ) const
inline

Get the contained object.

Definition at line 54 of file SlistNode.h.

◆ isTail()

bool utl::SlistNode::isTail ( ) const
inline

Determine whether self is the tail node.

Definition at line 61 of file SlistNode.h.

◆ isSentinelTail()

bool utl::SlistNode::isSentinelTail ( ) const
inline

Determine whether self is a "sentinal" tail node.

Definition at line 68 of file SlistNode.h.

References utl::maxObject.

◆ next()

SlistNode* utl::SlistNode::next ( ) const
inline

Get the next node (= self if self is tail node).

Definition at line 75 of file SlistNode.h.

◆ setNext()

void utl::SlistNode::setNext ( SlistNode node)
inline

Set the next node.

Definition at line 82 of file SlistNode.h.

◆ remove()

SlistNode* utl::SlistNode::remove ( SlistNode prev = nullptr)

Remove self from the list.

Returns
next node in chain
Parameters
prevprevious node

◆ set()

void utl::SlistNode::set ( const Object object)
inline

Set the contained object.

Definition at line 96 of file SlistNode.h.

References utl::init().


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