Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvStringList Class Reference

Class used to hold a group of PvString objects. More...

Public Member Functions

 PvStringList ()
 Constructor.
 
 ~PvStringList ()
 Destructor.
 
void Clear ()
 Clears the string list.
 
void Add (const PvString &aString)
 Adds an item to the list. More...
 
uint32_t GetSize () const
 Returns the size of the list. More...
 
PvStringGetItem (uint32_t aIndex)
 Returns a specific item from the list. More...
 
PvStringoperator[] (uint32_t aIndex)
 [] operator. More...
 
PvStringGetFirst ()
 Returns the first item of the list. More...
 
PvStringGetNext ()
 Returns the next item in the list. More...
 

Detailed Description

Class used to hold a group of PvString objects.

Used by the persistence objects (PvConfigurationReader, PvConfigurationWriter) to report a list of errors that happened during persistence operations. Since the load and save operations continue even if errors are encountered, more than one error can occur - making it difficult to capture in a single PvResult.

Assign your PvStringList to the persistence object before using it to load or save device, stream, strings or properties.

The list can be accessed iteratively with GetFirst and GetNext or randomly with GetSize, GetItem or the operator[].

How to use PvStringList with PvConfigurationReader or PvConfigurationWriter

lWriter.SetErrorList( &lList, "MyPrefix" );
// ...perform save operation
// Go through string list to retrieve all errors
PvString *lS = lList.GetFirst();
while ( lS != NULL )
{
// Do something with lS
// ...
lS = lList.GetNext();
}

Member Function Documentation

void PvStringList::Add ( const PvString aParameter)

Adds an item to the list.

Note
Adding an item in the list resets the GetFirst, GetNext internal iterator.
Parameters
[in]aParameterThe PvString to add to the list.
PvString * PvStringList::GetFirst ( )

Returns the first item of the list.

Sets the internal iterator to the first item. Subsequent calls to GetNext can be used to scroll through the list.

Returns
Pointer to the first item in the list, NULL if the list is empty.
PvString * PvStringList::GetItem ( uint32_t  aIndex)

Returns a specific item from the list.

Returns
A pointer to the requested PvString pointer.
Parameters
[in]aIndexof the item to get.
PvString * PvStringList::GetNext ( )

Returns the next item in the list.

Calling this method advances the internal iterator to the next item in the list.

NULL is returned if the end of the list is reached.

If GetFirst is not called before GetNext, the first call to GetNext returns the first item in the list.

Returns
Pointer to the next item in the list. NULL if the end of the list is reached.
uint32_t PvStringList::GetSize ( ) const

Returns the size of the list.

Returns
The size, or count of items contained in the list.
PvString * PvStringList::operator[] ( uint32_t  aIndex)

[] operator.

Returns
A pointer to the requested PvString pointer.
Parameters
[in]aIndexof the item to get.

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

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com