OSRTObjListClass Class Reference
This class represents a doubly-linked list structure for objects. More...
#include <rtxCppDList.h>
Public Member Functions | |
OSRTObjListClass () | |
The default constructor initializes the list contents to empty. | |
void | append (OSRTBaseType *pdata) |
The append method adds an item to the end of the list. | |
void | appendCopy (const OSRTBaseType *pdata) |
The appendCopy method adds a copy of an item to the end of the list. | |
OSRTObjListNodeClass * | getHead () |
This method returns a pointer to a head node of the list. | |
const OSRTObjListNodeClass * | getHead () const |
This method returns a pointer to a head node of the list. | |
const OSRTBaseType * | getItem (int idx) const |
The getItem method retrieves the data item from the list at the given index. | |
OSRTObjListNodeClass * | getTail () |
This method returns a pointer to a tail node of the list. | |
const OSRTObjListNodeClass * | getTail () const |
This method returns a pointer to a tail node of the list. | |
void | insert (int index, OSRTBaseType *pdata) |
The insert method inserts a data item into the list at the given indexed location. | |
OSRTObjListClass & | operator= (const OSRTObjListClass &) |
Assignment operator. |
Detailed Description
This class represents a doubly-linked list structure for objects.
It extends the C++ OSRTDListBaseClass
type. It is similar to the OSRTDListClass
described above except that the base type for items in the list is OSRTBaseType
. This allows items in the list to be properly destructed when memory ownership for the items is transferred to the list object.
Definition at line 339 of file rtxCppDList.h.
Member Function Documentation
void OSRTObjListClass::append | ( | OSRTBaseType * | 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 OSRTObjListClass::appendCopy | ( | const OSRTBaseType * | pdata | ) |
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.
const OSRTObjListNodeClass* OSRTObjListClass::getHead | ( | ) | const [inline] |
This method returns a pointer to a head node of the list.
- Returns:
- - Pointer to head node.
Definition at line 384 of file rtxCppDList.h.
OSRTObjListNodeClass* OSRTObjListClass::getHead | ( | ) | [inline] |
This method returns a pointer to a head node of the list.
- Returns:
- - Pointer to head node.
Definition at line 375 of file rtxCppDList.h.
const OSRTBaseType* OSRTObjListClass::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 395 of file rtxCppDList.h.
References OSRTObjListNodeClass::getData().
const OSRTObjListNodeClass* OSRTObjListClass::getTail | ( | ) | const [inline] |
This method returns a pointer to a tail node of the list.
- Returns:
- - Pointer to tail node.
Definition at line 415 of file rtxCppDList.h.
OSRTObjListNodeClass* OSRTObjListClass::getTail | ( | ) | [inline] |
This method returns a pointer to a tail node of the list.
- Returns:
- - Pointer to tail node.
Definition at line 406 of file rtxCppDList.h.
void OSRTObjListClass::insert | ( | int | index, | |
OSRTBaseType * | 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.
OSRTObjListClass& OSRTObjListClass::operator= | ( | const OSRTObjListClass & | ) |
Assignment operator.
Sets the list's value to the value of the given list. Note that a copy of each object in the given list is made.
The documentation for this class was generated from the following file: