Model Railroad System  2.2.1
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
Parsers::IntegerList Class Reference

The IntegerList class implements a linked list of integers, used for turnout route lists. More...

#include <IntegerList.h>

Public Member Functions

 IntegerList (int car=0, IntegerList *cdr=NULL)
 Base constructor. More...
 
int Element () const
 Element accessor. More...
 
const IntegerListNext () const
 Next pointer accessor (Const version). More...
 
IntegerListNext ()
 Next pointer accessor (non-Const version). More...
 
bool ElementP (int v) const
 Is value in the list? More...
 

Static Public Member Functions

static IntegerListIntAppend (IntegerList *head, int newTail)
 Add an element to the {end} of the list. More...
 
static void CleanUpIntegerList (IntegerList *list)
 Free up used memory. More...
 
static IntegerListCopyList (const IntegerList *src)
 

Private Attributes

int iElt
 The current element. More...
 
IntegerListnext
 The pointer to the next element. More...
 

Friends

class TurnoutBodyElt
 
ostream & operator<< (ostream &stream, IntegerList list)
 Output operator. More...
 

Detailed Description

The IntegerList class implements a linked list of integers, used for turnout route lists.

Author
Robert Heller <heller@deepsoft.com>

Constructor & Destructor Documentation

◆ IntegerList()

Parsers::IntegerList::IntegerList ( int  car = 0,
IntegerList cdr = NULL 
)
inline

Base constructor.

References iElt, and next.

Referenced by IntAppend().

Member Function Documentation

◆ CleanUpIntegerList()

static void Parsers::IntegerList::CleanUpIntegerList ( IntegerList list)
inlinestatic

Free up used memory.

References next.

◆ CopyList()

static IntegerList* Parsers::IntegerList::CopyList ( const IntegerList src)
inlinestatic

References iElt, IntAppend(), and next.

◆ Element()

int Parsers::IntegerList::Element ( ) const
inline

Element accessor.

References iElt.

◆ ElementP()

bool Parsers::IntegerList::ElementP ( int  v) const
inline

Is value in the list?

References iElt, and next.

◆ IntAppend()

static IntegerList* Parsers::IntegerList::IntAppend ( IntegerList head,
int  newTail 
)
inlinestatic

Add an element to the {end} of the list.

References IntegerList(), and next.

Referenced by CopyList().

◆ Next() [1/2]

IntegerList* Parsers::IntegerList::Next ( )
inline

Next pointer accessor (non-Const version).

References next.

◆ Next() [2/2]

const IntegerList* Parsers::IntegerList::Next ( ) const
inline

Next pointer accessor (Const version).

References next.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  stream,
IntegerList  list 
)
friend

Output operator.

◆ TurnoutBodyElt

friend class TurnoutBodyElt
friend

Member Data Documentation

◆ iElt

int Parsers::IntegerList::iElt
private

The current element.

Referenced by CopyList(), Element(), ElementP(), and IntegerList().

◆ next

IntegerList* Parsers::IntegerList::next
private

The pointer to the next element.

Referenced by CleanUpIntegerList(), CopyList(), ElementP(), IntAppend(), IntegerList(), and Next().