OSRTDListClass Class Reference

This class represents a doubly-linked list structure. More...

#include <rtxCppDList.h>

Inheritance diagram for OSRTDListClass:
OSRTDListBaseClass OSRTBaseType

List of all members.

Public Member Functions

 OSRTDListClass ()
 The default constructor initializes the list contents to empty.
 OSRTDListClass (const OSRTDListClass &o)
 The copy constructor makes a copy of the list object.
void append (void *pdata)
 The append method adds an item to the end of the list.
void appendCopy (void *pdata, size_t nbytes)
 The appendCopy method adds a copy of an item to the end of the list.
OSRTDListNodeClassgetHead ()
 This method returns a pointer to a head node of the list.
const OSRTDListNodeClassgetHead () const
 This method returns a pointer to a head node of the list.
const void * getItem (int idx) const
 The getItem method retrieves the data item from the list at the given index.
OSRTDListNodeClassgetTail ()
 This method returns a pointer to a tail node of the list.
const OSRTDListNodeClassgetTail () const
 This method returns a pointer to a tail node of the list.
void insert (int index, void *pdata)
 The insert method inserts a data item into the list at the given indexed location.

Detailed Description

This class represents a doubly-linked list structure.

It extends the C++ OSRTDListBaseClass type. It provides methods for adding, retrieving, and removing items from linked lists. This list class is used to hold primitive types which are NOT derived from OSRTBaseType. See description of OSRTObjListClass for list of objects class.

Definition at line 240 of file rtxCppDList.h.


Member Function Documentation

void OSRTDListClass::append ( void *  pdata  ) 

The append method adds an item to the end of the list.

Parameters:
pdata - Pointer to data item to be appended to list. Note the pointer itself is appended - a copy is not made.
void OSRTDListClass::appendCopy ( void *  pdata,
size_t  nbytes 
)

The appendCopy method adds a copy of an item to the end of the list.

Parameters:
pdata - Pointer to data item to be appended to list. Note that clone() is called on the data item, and the returned copy is stored in the list.
nbytes - Size of the data pointed to in bytes.
const OSRTDListNodeClass* OSRTDListClass::getHead (  )  const [inline]

This method returns a pointer to a head node of the list.

Returns:
- Pointer to head node.

Definition at line 284 of file rtxCppDList.h.

OSRTDListNodeClass* OSRTDListClass::getHead (  )  [inline]

This method returns a pointer to a head node of the list.

Returns:
- Pointer to head node.

Definition at line 275 of file rtxCppDList.h.

const void* OSRTDListClass::getItem ( int  idx  )  const [inline]

The getItem method retrieves the data item from the list at the given index.

The index is zero-based.

Parameters:
idx - Zero-based index of the node to retrieve.
Returns:
- Pointer to node structure containing the indexed data item.

Definition at line 295 of file rtxCppDList.h.

References OSRTDListNodeClass::getData().

const OSRTDListNodeClass* OSRTDListClass::getTail (  )  const [inline]

This method returns a pointer to a tail node of the list.

Returns:
- Pointer to tail node.

Definition at line 315 of file rtxCppDList.h.

OSRTDListNodeClass* OSRTDListClass::getTail (  )  [inline]

This method returns a pointer to a tail node of the list.

Returns:
- Pointer to tail node.

Definition at line 306 of file rtxCppDList.h.

void OSRTDListClass::insert ( int  index,
void *  pdata 
)

The insert method inserts a data item into the list at the given indexed location.

The index is zero-based.

Parameters:
index - Zero-based index of insertion point.
pdata - Pointer to data item to be inserted into list. Note the pointer itself is inserted - a copy is not made.

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