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. | |
| PvResult | LoadFromString (const PvString &aString) |
| Loads configuration data from a string. | |
| uint32_t | GetDeviceCount () |
| Returns the number of devices stored in the configuration. | |
| PvResult | GetDeviceName (uint32_t aIndex, PvString &aName) |
| Gets the name of a device at the specified index. | |
| PvResult | Restore (const PvString &aName, PvDevice *aDevice) |
| Restores configuration to a device by name. | |
| PvResult | Restore (uint32_t aIndex, PvDevice *aDevice) |
| Restores configuration to a device by index. | |
| uint32_t | GetStreamCount () |
| Returns the number of streams stored in the configuration. | |
| PvResult | GetStreamName (uint32_t aIndex, PvString &aName) |
| Gets the name of a stream at the specified index. | |
| PvResult | Restore (const PvString &aName, PvStream *aStream) |
| Restores configuration to a stream by name. | |
| PvResult | Restore (uint32_t aIndex, PvStream *Stream) |
| Restores configuration to a stream by index. | |
| uint32_t | GetStringCount () |
| Returns the number of strings stored in the configuration. | |
| PvResult | GetStringName (uint32_t aIndex, PvString &aName) |
| Gets the name of a string entry at the specified index. | |
| PvResult | Restore (const PvString &aKey, PvString &aValue) |
| Restores a string value by key. | |
| PvResult | Restore (uint32_t aIndex, PvString &aValue) |
| Restores a string value by index. | |
| uint32_t | GetGenParameterArrayCount () |
| Returns the number of GenICam parameter arrays stored in the configuration. | |
| PvResult | GetGenParameterArrayName (uint32_t aIndex, PvString &aName) |
| Gets the name of a GenICam parameter array at the specified index. | |
| PvResult | Restore (const PvString &aKey, PvGenParameterArray *aParameterArray) |
| Restores configuration to a GenICam parameter array by key. | |
| PvResult | Restore (uint32_t aIndex, PvGenParameterArray *aParameterArray) |
| Restores configuration to a GenICam parameter array by index. | |
| uint32_t | GetPropertyListCount () |
| Returns the number of property lists stored in the configuration. | |
| PvResult | GetPropertyListName (uint32_t aIndex, PvString &aName) |
| Gets the name of a property list at the specified index. | |
| PvResult | Restore (const PvString &aKey, PvPropertyList *aPropertyList) |
| Restores configuration to a property list by key. | |
| PvResult | Restore (uint32_t aIndex, PvPropertyList *aPropertyList) |
| Restores configuration to a property list by index. | |
| void | SetErrorList (PvStringList *aList, const PvString &aPrefix) |
| Sets the error list for collecting error messages during restore operations. | |
Reads and restores configuration data from persistence files.
Restore the state of the system.
To load your GigE Vision or USB3 Vision device controller (PvDevice object) or stream controller (PvStream object) state from disk:
For a simple example illustrating how to use PvConfigurationWriter to store a configuration and PvConfigurationReader to retrieve it, refer to the sample entitled ConfigurationReader.
| uint32_t PvConfigurationReader::GetDeviceCount | ( | ) |
Returns the number of devices stored in the configuration.
Get the number of PvDevice configurations available.
This family of methods returns the number of configurations in a configuration file. The methods include:
Gets the name of a device at the specified index.
Get the configuration name (PvDevice).
| [in] | aIndex | Index of the device. |
| [out] | aName | Name of the device. |
The Get*Name methods let you determine the name of the configuration before calling the Restore methods.
| [in] | aIndex | The index within the list of the devices; a value between 0 and GetDeviceCount-1. |
| [out] | aName | The configuration's name; the name stored using the aName parameter in the PvConfigurationWriter::Store method. |
| 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.
See GetDeviceCount.
Gets the name of a GenICam parameter array at the specified index.
Get the configuration name (PvGenParameterArray).
| [in] | aIndex | Index of the parameter array. |
| [out] | aName | Name of the parameter array. |
See GetDeviceName.
| [in] | aIndex | See GetDeviceName. |
| [out] | aName | See GetDeviceName. |
| 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.
See GetDeviceCount.
Gets the name of a property list at the specified index.
Get the configuration name (PvPropertyList).
| [in] | aIndex | Index of the property list. |
| [out] | aName | Name of the property list. |
See GetDeviceName.
| [in] | aIndex | See GetDeviceName. |
| [out] | aName | See GetDeviceName. |
| uint32_t PvConfigurationReader::GetStreamCount | ( | ) |
Returns the number of streams stored in the configuration.
Get the number of stream configuration in this PvConfigurationReader.
See GetDeviceCount.
Gets the name of a stream at the specified index.
Get the configuration name (PvStream).
| [in] | aIndex | Index of the stream. |
| [out] | aName | Name of the stream. |
See GetDeviceName.
| [in] | aIndex | See GetDeviceName. |
| [out] | aName | See GetDeviceName. |
| uint32_t PvConfigurationReader::GetStringCount | ( | ) |
Returns the number of strings stored in the configuration.
Get the number of custom-state strings in the configuration file.
See GetDeviceCount.
Gets the name of a string entry at the specified index.
Get the custom-state string name (PvString)
| [in] | aIndex | Index of the string entry. |
| [out] | aName | Name of the string entry. |
See GetDeviceName.
| [in] | aIndex | See GetDeviceName. |
| [out] | aName | See GetDeviceName. |
Loads configuration data from a file.
Load a configuration file from disk.
| [in] | aFilename | Path to the configuration file. |
The Load method loads a configuration file from disk into the PvConfigurationReader object's internal memory. To apply a configuration state, use Restore.
| [in] | aFilename | The configuration file's name and path. |
Loads configuration data from a string.
Loads a configuration from a string.
| [in] | aString | String containing the configuration data. |
The Load method loads a configuration from a string into the PvConfigurationReader object's internal memory. To apply a configuration state, use Restore.
| [in] | aString | The configuration to load. |
| PvResult PvConfigurationReader::Restore | ( | const PvString & | aName, |
| PvGenParameterArray * | aParameterArray | ||
| ) |
Restores configuration to a GenICam parameter array by key.
Apply a configuration to a PvGenParameterArray.
| [in] | aKey | Key of the stored parameter array configuration. |
| [in] | aParameterArray | Parameter array to restore configuration to. |
See Restore(const PvString&,PvDevice*).
| [in] | aName | Name of the parameter array to restore from the persistence data |
| [out] | aParameterArray | Reference to the parameter array to restore that data to |
| PvResult PvConfigurationReader::Restore | ( | const PvString & | aName, |
| PvPropertyList * | aPropertyList | ||
| ) |
Restores configuration to a property list by key.
Retrieves the data to a PvPropertyList.
| [in] | aKey | Key of the stored property list configuration. |
| [in] | aPropertyList | Property list to restore configuration to. |
See Restore(const PvString&,PvDevice*).
| [in] | aName | Name of the property list to restore from the persistence data |
| [out] | aPropertyList | Reference to the property list to restore that data to |
Restores a string value by key.
Apply a configuration.
| [in] | aKey | Key of the stored string. |
| [out] | aValue | Restored string value. |
See Restore(const PvString&,PvDevice*).
| [in] | aName | See Restore(const PvString&,PvDevice*). |
| [out] | aString | See Restore(const PvString&,PvDevice*), aDevice parameter. |
Restores configuration to a device by name.
Apply a configuration.
| [in] | aName | Name of the stored device configuration. |
| [in] | aDevice | Device to restore configuration to. |
This method is identical to the Restore(uint32_t,PvDevice*) family of methods, with the following exceptions:
| [in] | aName | The configuration name. |
| [in] | aDevice | The target that receives the new configuration. The target might be a PvDevice (aDevice, a PvStream (aStream), or a custom configuration (aString). |
Restores configuration to a stream by name.
Apply a configuration to a PvStream.
| [in] | aName | Name of the stored stream configuration. |
| [in] | aStream | Stream to restore configuration to. |
See Restore(const PvString&,PvDevice*).
| [in] | aName | See Restore(const PvString&,PvDevice*). |
| [out] | aStream | See Restore(const PvString&,PvDevice*), aDevice parameter. |
Restores configuration to a device by index.
Apply a configuration to a PvDevice.
| [in] | aIndex | Index of the stored device configuration. |
| [in] | aDevice | Device to restore configuration to. |
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.
| [in] | aIndex | The configuration's index number. |
| [in] | aDevice | The target that receives the new configuration. The target might be a PvDevice (aDevice, a PvStream (aStream), or a custom configuration (aString). |
| PvResult PvConfigurationReader::Restore | ( | uint32_t | aIndex, |
| PvGenParameterArray * | aParameterArray | ||
| ) |
Restores configuration to a GenICam parameter array by index.
Apply a configuration to a PvGenParameterArray.
| [in] | aIndex | Index of the stored parameter array configuration. |
| [in] | aParameterArray | Parameter array to restore configuration to. |
See Restore(uint32_t,PvDevice*).
| [in] | aIndex | Index of the parameter array to restore from the persistence data |
| [out] | aParameterArray | Reference to the parameter array to restore that data to |
| PvResult PvConfigurationReader::Restore | ( | uint32_t | aIndex, |
| PvPropertyList * | aPropertyList | ||
| ) |
Restores configuration to a property list by index.
Retrieves the data to a PvPropertyList.
| [in] | aIndex | Index of the stored property list configuration. |
| [in] | aPropertyList | Property list to restore configuration to. |
See Restore(const PvString&,PvDevice*).
| [in] | aIndex | Index of the property list to restore from the persistence data |
| [out] | aPropertyList | Reference to the property list to restore that data to |
Restores configuration to a stream by index.
Apply a configuration to a PvStream.
| [in] | aIndex | Index of the stored stream configuration. |
| [in] | Stream | Stream to restore configuration to. |
See Restore(uint32_t,PvDevice*).
| [in] | aIndex | See Restore(uint32_t,PvDevice*). |
| [out] | aStream | See Restore(uint32_t,PvDevice*), aDevice parameter. |
Restores a string value by index.
Apply a configuration.
| [in] | aIndex | Index of the stored string. |
| [out] | aValue | Restored string value. |
See Restore(uint32_t,PvDevice*).
| [in] | aIndex | See Restore(uint32_t,PvString&). |
| [out] | aString | See Restore(uint32_t,PvDevice*), aDevice parameter. |
| 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.
| [in] | aList | String list to receive error messages. |
| [in] | aPrefix | Prefix to add to error messages. |
| [in] | aList | A pointer to a string list. The content of the list is not reset, new errors are simply added to the list. |
| [in] | aPrefix | A contextual prefix prepended to all errors as they are added to the error list. |
Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com