GlobalObjects
|
A void-pointer list. More...
#include <PtlVDVList.h>
Public Member Functions | |
VDVList (const VDVList &rList) | |
VDVList (ListMode eMode=DEFAULT) | |
virtual | ~VDVList () |
virtual int | addElementFrom (const VDVList &rList) |
int | currentElementCache (ElementCache eWhich) |
virtual void * | get (ElementPosition eElementPos=FIRST_POS) override |
int | get (void *&prRetVal, std::size_t nPosition, DVElement *pRefElement) |
int | get (void *&prRetVal, std::size_t nPosition, SeekMode eMode) |
virtual int | insert (void *pDataObject, InsertPosition eWhere=InsertLAST, VH eBeforeBehind=BEHIND) override |
VDVList & | operator= (const VDVList &rList) |
int | remove (ElementPosition eElementPos=CURRENT_POS) |
virtual void | removeAll () override |
int | setCurrentPosition (void *pDataObject) |
Public Member Functions inherited from ptl::AVDVList | |
AVDVList (const AVDVList &rList) | |
AVDVList (ListMode eMode=DEFAULT) | |
virtual | ~AVDVList () |
int | getErrorCode () |
ListMode | getListMode () |
std::size_t | getNumberDataObjects (void *pDataObject) |
std::size_t | getSize () |
AVDVList & | operator= (const AVDVList &rList) |
Protected Attributes | |
DVElement * | m_pCurrentDVElement |
DVElement * | m_pTempCurrentDVElement |
Protected Attributes inherited from ptl::AVDVList | |
ListMode | m_eListMode |
int | m_iErrorCode |
std::size_t | m_nSize |
DVElement * | m_pFirstDVElement |
DVElement * | m_pLastDVElement |
Additional Inherited Members | |
Protected Member Functions inherited from ptl::AVDVList | |
virtual int | _addElementFrom (const AVDVList &rList) |
DVElement * | insertSrc (void *pDataObject, DVElement *pReferenceDVElement, VH eBeforeBehind) |
DVElement * | removeSrc (DVElement *pDeadDVElement) |
A void-pointer list.
A VDVList consists of list elements of type DVElement, which pointers to the objects to be managed. The first, last and current element can be queried. In addition, a subsequent one can be requested, or previous element (with respect to the current element) can be selected.
An element can be inserted before or after the first, last and current element will be. This can be restricted by setting a UNIQUE list in the following way that objects may only appear once in the list.
constructor with optional parameter passing. The list is empty at first. You can use the parameter UNIQUE to create a list that only takes a data object once.
[in] | eMode | The list mode |
|
virtual |
Destructor.
ptl::VDVList::VDVList | ( | const VDVList & | rList | ) |
Copy constructor.
[in] | rList | The VDVList to be copied. |
eut::ErrorNException | If an error occurs, a exception is thrown. |
|
virtual |
Copies all list elements of type DVElement from rList to this list. Also used by VDVList::operator=.
[in] | rList | The list from which the objects are taken. |
int ptl::VDVList::currentElementCache | ( | ElementCache | eWhich | ) |
This method allows you to cache or restore the current pointer.
[in] | eWhich | Specifies whether the pointer to the current element is cached (M) or restored (RM). |
|
overridevirtual |
Returns a void pointer to the data from the position specified in the parameter.
If an element was delivered, it becomes the current element, otherwise the current element remains what it was.
[in] | eElementPos | Which data should be delivered? Possible values are FIRST_POS, LAST_POS, CURRENT_POS, NEXT_POS or PREVIOUS_POS. |
Reimplemented from ptl::AVDVList.
int ptl::VDVList::get | ( | void *& | prRetVal, |
std::size_t | nPosition, | ||
DVElement * | pRefElement ) |
Returns a void pointer to an object in prRetVal from passed position with respect to passed pointer to an element.
[in,out] | prRetVal | In the passed void pointer a found object is returned. |
[in] | nPosition | The position relative to the transferred pRefElement |
[in] | pRefElement | The reference element |
int ptl::VDVList::get | ( | void *& | prRetVal, |
std::size_t | nPosition, | ||
SeekMode | eMode ) |
Returns a void pointer to an object in prRetVal from the list with respect to the transfer parameters.
You can use this method to iterate through the list.
[in,out] | prRetVal | In the passed pointer a found object delivered. |
[in] | nPosition | The position relative to the search mode. |
[in] | eMode | The search mode. |
Parameter examples:
|
overridevirtual |
This method inserts the void pointer to a data object in the list. The current element is set to the new element.
If the list was instantiated with parameter UNIQUE and the data object is already in the list, it is not inserted.
[in] | pDataObject | Is the void pointer to the data object. |
[in] | eWhere | Indicates where the data object is to be inserted in the list. Possible parameters are InsertHEAD, InsertLAST and InsertCURRENT . |
[in] | eBeforeBehind | Indicates whether the new element is placed before or after the element specified in the eWhere parameter. Possible parameters are BEFORE and BEHIND. |
Reimplemented from ptl::AVDVList.
Assignment operator=
During an assignment, all own DVElements are removed and then all data objects from the assigning VDVList are transferred to new own DVElements.
[in] | rList | The list to be assigned. |
It should be called after call getErrorCode().
int ptl::VDVList::remove | ( | ElementPosition | eElementPos = CURRENT_POS | ) |
|
overridevirtual |
Removes all elements from the list.
Reimplemented from ptl::AVDVList.
int ptl::VDVList::setCurrentPosition | ( | void * | pDataObject | ) |
If there is a PtlDV element with the passed pointer in the list, the current pointer is set to the PtlDV element, otherwise the current pointer remains what it was.
[in] | pDataObject | The data object you are looking for |
|
protected |
The reference to the current element in the list. If the list is empty, the current element is equal to NULL_PTR.
|
protected |
This attribute is a cache of the current element. It is set in the currentElementCache (...) method.