Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvPropertyList Class Reference

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

Public Member Functions

 PvPropertyList ()
 Constructor.
 
 ~PvPropertyList ()
 Destructor.
 
void Clear ()
 Clears the Property list.
 
void Add (const PvProperty &aString)
 Adds an item to the list. More...
 
uint32_t GetSize () const
 Returns the size of the list. More...
 
PvPropertyGetItem (uint32_t aIndex)
 Returns a specific item from the list. More...
 
PvPropertyoperator[] (uint32_t aIndex)
 [] operator. More...
 
PvPropertyGetFirst ()
 Returns the first item of the list. More...
 
PvPropertyGetNext ()
 Returns the next item in the list. More...
 
PvPropertyGetProperty (const PvString &aName)
 Returns a property from its name. More...
 

Detailed Description

Class used to hold a group of PvProperty objects.

A list of property can be persisted as a single entity in a PvConfigurationReader or PvConfigurationWriter. It allows grouping generic parameters together - the alternative would have been to save (and then load) individual strings.

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

How to use PvPropertyList with PvConfigurationWriter

// Create a property list, add some parameters
lList.Add( "Param1", "Value1" );
lList.Add( "Param2", "1234" );
// Save list to configuration writer
lWriter.Store( &lList, "MyParams" );
lWriter.Save( "MyFile.pvcfg" );

How to use PvPropertyList with PvConfigurationReader

// Load property list
lReader.Load( "MyFile.pvcfg" );
lReader.Restore( "MyParams", lList );
// Go through all properties
PvProperty *lP = lList.GetFirst();
while ( lP != NULL )
{
cout << "Name: " << lP->GetName().GetAscii() << " value: " << lP->GetValue().GetAscii() << endl;
lP = lList.GetNext();
}

Member Function Documentation

void PvPropertyList::Add ( const PvProperty aParameter)

Adds an item to the list.

Note
Adding an item in the list resets the GetFirst, GetNext internal iterator.
Parameters
[in]aParameterThe PvProperty to add to the list.
PvProperty * PvPropertyList::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.
PvProperty * PvPropertyList::GetItem ( uint32_t  aIndex)

Returns a specific item from the list.

Returns
A pointer to the requested PvProperty pointer.
Parameters
[in]aIndexof the item to get.
PvProperty * PvPropertyList::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.
PvProperty * PvPropertyList::GetProperty ( const PvString aName)

Returns a property from its name.

Parameters
aName[in] Property name.
Returns
Property if name is found, NULL if not.
uint32_t PvPropertyList::GetSize ( ) const

Returns the size of the list.

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

[] operator.

Returns
A pointer to the requested PvProperty 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