Pleora Technologies Inc. eBUS SDK v7.0.1.7536 API



PvConfigurationReader Class Reference

Reads and restores configuration data from persistence files. More...

#include <PvConfigurationReader.h>

Public Member Functions

 PvConfigurationReader ()
 Constructor.
 
 ~PvConfigurationReader ()
 Destructor.
 
PvResult Load (const PvString &aFilename)
 Loads configuration data from a file. More...
 
PvResult LoadFromString (const PvString &aString)
 Loads configuration data from a string. More...
 
uint32_t GetDeviceCount ()
 Returns the number of devices stored in the configuration. More...
 
PvResult GetDeviceName (uint32_t aIndex, PvString &aName)
 Gets the name of a device at the specified index. More...
 
PvResult Restore (const PvString &aName, PvDevice *aDevice)
 Restores configuration to a device by name. More...
 
PvResult Restore (uint32_t aIndex, PvDevice *aDevice)
 Restores configuration to a device by index. More...
 
uint32_t GetStreamCount ()
 Returns the number of streams stored in the configuration. More...
 
PvResult GetStreamName (uint32_t aIndex, PvString &aName)
 Gets the name of a stream at the specified index. More...
 
PvResult Restore (const PvString &aName, PvStream *aStream)
 Restores configuration to a stream by name. More...
 
PvResult Restore (uint32_t aIndex, PvStream *Stream)
 Restores configuration to a stream by index. More...
 
uint32_t GetStringCount ()
 Returns the number of strings stored in the configuration. More...
 
PvResult GetStringName (uint32_t aIndex, PvString &aName)
 Gets the name of a string entry at the specified index. More...
 
PvResult Restore (const PvString &aKey, PvString &aValue)
 Restores a string value by key. More...
 
PvResult Restore (uint32_t aIndex, PvString &aValue)
 Restores a string value by index. More...
 
uint32_t GetGenParameterArrayCount ()
 Returns the number of GenICam parameter arrays stored in the configuration. More...
 
PvResult GetGenParameterArrayName (uint32_t aIndex, PvString &aName)
 Gets the name of a GenICam parameter array at the specified index. More...
 
PvResult Restore (const PvString &aKey, PvGenParameterArray *aParameterArray)
 Restores configuration to a GenICam parameter array by key. More...
 
PvResult Restore (uint32_t aIndex, PvGenParameterArray *aParameterArray)
 Restores configuration to a GenICam parameter array by index. More...
 
uint32_t GetPropertyListCount ()
 Returns the number of property lists stored in the configuration. More...
 
PvResult GetPropertyListName (uint32_t aIndex, PvString &aName)
 Gets the name of a property list at the specified index. More...
 
PvResult Restore (const PvString &aKey, PvPropertyList *aPropertyList)
 Restores configuration to a property list by key. More...
 
PvResult Restore (uint32_t aIndex, PvPropertyList *aPropertyList)
 Restores configuration to a property list by index. More...
 
void SetErrorList (PvStringList *aList, const PvString &aPrefix)
 Sets the error list for collecting error messages during restore operations. More...
 

Detailed Description

Reads and restores configuration data from persistence files.

Restore the state of the system.

Remarks
This class provides methods to load configuration data and restore it to devices, streams, parameter arrays, and property lists.

See PvConfigurationWriter.

To load your GigE Vision or USB3 Vision device controller (PvDevice object) or stream controller (PvStream object) state from disk:

  1. Create a configuration reader.
  2. Load the file from disk. Use Load.
  3. Get the number of configurations.
  4. Optionally, test for the name of a configuration.
  5. Apply a configuration to an object.
Note
If the device controller (PvDevice object) isn't connected to the GigE Vision or USB3 Vision device, it attempts to connect (as if calling PvDevice::Connect). If already connected, the settings are applied without changing the IP address and related information. The same applies to a PvStream that is already opened.

For a simple example illustrating how to use PvConfigurationWriter to store a configuration and PvConfigurationReader to retrieve it, refer to the sample entitled ConfigurationReader.

Member Function Documentation

◆ GetDeviceCount()

uint32_t PvConfigurationReader::GetDeviceCount ( )

Returns the number of devices stored in the configuration.

Get the number of PvDevice configurations available.

Returns
Device count.

This family of methods returns the number of configurations in a configuration file. The methods include:

Returns
The number of configurations.

◆ GetDeviceName()

PvResult PvConfigurationReader::GetDeviceName ( uint32_t  aIndex,
PvString aName 
)

Gets the name of a device at the specified index.

Get the configuration name (PvDevice).

Parameters
[in]aIndexIndex of the device.
[out]aNameName of the device.
Returns
Result of the operation.

The Get*Name methods let you determine the name of the configuration before calling the Restore methods.

Parameters
[in]aIndexThe index within the list of the devices; a value between 0 and GetDeviceCount-1.
[out]aNameThe configuration's name; the name stored using the aName parameter in the PvConfigurationWriter::Store method.
Returns
Includes:

◆ GetGenParameterArrayCount()

uint32_t PvConfigurationReader::GetGenParameterArrayCount ( )

Returns the number of GenICam parameter arrays stored in the configuration.

Get the number of PvGenParameterArray objects saved in the configuration file.

Returns
GenICam parameter array count.

See GetDeviceCount.

Returns
See GetDeviceCount.

◆ GetGenParameterArrayName()

PvResult PvConfigurationReader::GetGenParameterArrayName ( uint32_t  aIndex,
PvString aName 
)

Gets the name of a GenICam parameter array at the specified index.

Get the configuration name (PvGenParameterArray).

Parameters
[in]aIndexIndex of the parameter array.
[out]aNameName of the parameter array.
Returns
Result of the operation.

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.

◆ GetPropertyListCount()

uint32_t PvConfigurationReader::GetPropertyListCount ( )

Returns the number of property lists stored in the configuration.

Get the number of PvPropertyList objects saved in the configuration file.

Returns
Property list count.

See GetDeviceCount.

Returns
See GetDeviceCount.

◆ GetPropertyListName()

PvResult PvConfigurationReader::GetPropertyListName ( uint32_t  aIndex,
PvString aName 
)

Gets the name of a property list at the specified index.

Get the configuration name (PvPropertyList).

Parameters
[in]aIndexIndex of the property list.
[out]aNameName of the property list.
Returns
Result of the operation.

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.

◆ GetStreamCount()

uint32_t PvConfigurationReader::GetStreamCount ( )

Returns the number of streams stored in the configuration.

Get the number of stream configuration in this PvConfigurationReader.

Returns
Stream count.

See GetDeviceCount.

Returns
See GetDeviceCount.

◆ GetStreamName()

PvResult PvConfigurationReader::GetStreamName ( uint32_t  aIndex,
PvString aName 
)

Gets the name of a stream at the specified index.

Get the configuration name (PvStream).

Parameters
[in]aIndexIndex of the stream.
[out]aNameName of the stream.
Returns
Result of the operation.

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.

◆ GetStringCount()

uint32_t PvConfigurationReader::GetStringCount ( )

Returns the number of strings stored in the configuration.

Get the number of custom-state strings in the configuration file.

Returns
String count.

See GetDeviceCount.

Returns
See GetDeviceCount.

◆ GetStringName()

PvResult PvConfigurationReader::GetStringName ( uint32_t  aIndex,
PvString aName 
)

Gets the name of a string entry at the specified index.

Get the custom-state string name (PvString)

Parameters
[in]aIndexIndex of the string entry.
[out]aNameName of the string entry.
Returns
Result of the operation.

See GetDeviceName.

Parameters
[in]aIndexSee GetDeviceName.
[out]aNameSee GetDeviceName.
Returns
See GetDeviceName.

◆ Load()

PvResult PvConfigurationReader::Load ( const PvString aFilename)

Loads configuration data from a file.

Load a configuration file from disk.

Parameters
[in]aFilenamePath to the configuration file.
Returns
Result of the operation.

The Load method loads a configuration file from disk into the PvConfigurationReader object's internal memory. To apply a configuration state, use Restore.

Parameters
[in]aFilenameThe configuration file's name and path.
Returns
Includes:

◆ LoadFromString()

PvResult PvConfigurationReader::LoadFromString ( const PvString aString)

Loads configuration data from a string.

Loads a configuration from a string.

Parameters
[in]aStringString containing the configuration data.
Returns
Result of the operation.

The Load method loads a configuration from a string into the PvConfigurationReader object's internal memory. To apply a configuration state, use Restore.

Parameters
[in]aStringThe configuration to load.
Returns
Includes:

◆ Restore() [1/10]

PvResult PvConfigurationReader::Restore ( const PvString aName,
PvGenParameterArray aParameterArray 
)

Restores configuration to a GenICam parameter array by key.

Apply a configuration to a PvGenParameterArray.

Parameters
[in]aKeyKey of the stored parameter array configuration.
[in]aParameterArrayParameter array to restore configuration to.
Returns
Result of the operation.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameName of the parameter array to restore from the persistence data
[out]aParameterArrayReference to the parameter array to restore that data to
Returns
Includes:

◆ Restore() [2/10]

PvResult PvConfigurationReader::Restore ( const PvString aName,
PvPropertyList aPropertyList 
)

Restores configuration to a property list by key.

Retrieves the data to a PvPropertyList.

Parameters
[in]aKeyKey of the stored property list configuration.
[in]aPropertyListProperty list to restore configuration to.
Returns
Result of the operation.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameName of the property list to restore from the persistence data
[out]aPropertyListReference to the property list to restore that data to
Returns
Includes:

◆ Restore() [3/10]

PvResult PvConfigurationReader::Restore ( const PvString aName,
PvString aString 
)

Restores a string value by key.

Apply a configuration.

Parameters
[in]aKeyKey of the stored string.
[out]aValueRestored string value.
Returns
Result of the operation.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameSee Restore(const PvString&,PvDevice*).
[out]aStringSee Restore(const PvString&,PvDevice*), aDevice parameter.
Returns
See Restore(const PvString&,PvDevice*).

◆ Restore() [4/10]

PvResult PvConfigurationReader::Restore ( const PvString aName,
PvDevice aDevice 
)

Restores configuration to a device by name.

Apply a configuration.

Parameters
[in]aNameName of the stored device configuration.
[in]aDeviceDevice to restore configuration to.
Returns
Result of the operation.

This method is identical to the Restore(uint32_t,PvDevice*) family of methods, with the following exceptions:

  • These methods identify the configuration by name (aName) rather than index number (aIndex).
Parameters
[in]aNameThe configuration name.
[in]aDeviceThe target that receives the new configuration. The target might be a PvDevice (aDevice, a PvStream (aStream), or a custom configuration (aString).
Returns
Includes:

◆ Restore() [5/10]

PvResult PvConfigurationReader::Restore ( const PvString aName,
PvStream aStream 
)

Restores configuration to a stream by name.

Apply a configuration to a PvStream.

Parameters
[in]aNameName of the stored stream configuration.
[in]aStreamStream to restore configuration to.
Returns
Result of the operation.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aNameSee Restore(const PvString&,PvDevice*).
[out]aStreamSee Restore(const PvString&,PvDevice*), aDevice parameter.
Returns
Includes:

◆ Restore() [6/10]

PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvDevice aDevice 
)

Restores configuration to a device by index.

Apply a configuration to a PvDevice.

Parameters
[in]aIndexIndex of the stored device configuration.
[in]aDeviceDevice to restore configuration to.
Returns
Result of the operation.

The Restore methods apply a configuration loaded into a configuration reader (using the Load method) to a GigE Vision or USB3 Vision device.

In general, the parameters for the Restore methods use a (ConfigurationIdentifier, Target) format. The ConfigurationIdentifier is the configuration's name or index number; Target is the PvDevice object, PvStream object, or custom string that receives the state.

Parameters
[in]aIndexThe configuration's index number.
[in]aDeviceThe target that receives the new configuration. The target might be a PvDevice (aDevice, a PvStream (aStream), or a custom configuration (aString).
Returns
Includes:

◆ Restore() [7/10]

PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvGenParameterArray aParameterArray 
)

Restores configuration to a GenICam parameter array by index.

Apply a configuration to a PvGenParameterArray.

Parameters
[in]aIndexIndex of the stored parameter array configuration.
[in]aParameterArrayParameter array to restore configuration to.
Returns
Result of the operation.

See Restore(uint32_t,PvDevice*).

Parameters
[in]aIndexIndex of the parameter array to restore from the persistence data
[out]aParameterArrayReference to the parameter array to restore that data to
Returns
Includes:

◆ Restore() [8/10]

PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvPropertyList aPropertyList 
)

Restores configuration to a property list by index.

Retrieves the data to a PvPropertyList.

Parameters
[in]aIndexIndex of the stored property list configuration.
[in]aPropertyListProperty list to restore configuration to.
Returns
Result of the operation.

See Restore(const PvString&,PvDevice*).

Parameters
[in]aIndexIndex of the property list to restore from the persistence data
[out]aPropertyListReference to the property list to restore that data to
Returns
Includes:

◆ Restore() [9/10]

PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvStream aStream 
)

Restores configuration to a stream by index.

Apply a configuration to a PvStream.

Parameters
[in]aIndexIndex of the stored stream configuration.
[in]StreamStream to restore configuration to.
Returns
Result of the operation.

See Restore(uint32_t,PvDevice*).

Parameters
[in]aIndexSee Restore(uint32_t,PvDevice*).
[out]aStreamSee Restore(uint32_t,PvDevice*), aDevice parameter.
Returns
See Restore(uint32_t,PvDevice*).

◆ Restore() [10/10]

PvResult PvConfigurationReader::Restore ( uint32_t  aIndex,
PvString aString 
)

Restores a string value by index.

Apply a configuration.

Parameters
[in]aIndexIndex of the stored string.
[out]aValueRestored string value.
Returns
Result of the operation.

See Restore(uint32_t,PvDevice*).

Parameters
[in]aIndexSee Restore(uint32_t,PvString&).
[out]aStringSee Restore(uint32_t,PvDevice*), aDevice parameter.
Returns
Includes:

◆ SetErrorList()

void PvConfigurationReader::SetErrorList ( PvStringList aList,
const PvString aPrefix 
)

Sets the error list for collecting error messages during restore operations.

Sets the error list where all errors/warnings are logged.

Parameters
[in]aListString list to receive error messages.
[in]aPrefixPrefix to add to error messages.
[in]aListA pointer to a string list. The content of the list is not reset, new errors are simply added to the list.
[in]aPrefixA contextual prefix prepended to all errors as they are added to the error list.

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

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