Restore the state of the system. More...
Public Member Functions | |
PvConfigurationReader () | |
Constructor. | |
~PvConfigurationReader () | |
Destructor. | |
PvResult | Load (const PvString &aFilename) |
Load a configuration file from disk. More... | |
PvResult | LoadFromString (const PvString &aString) |
Loads a configuration from a string. More... | |
uint32_t | GetDeviceCount () |
Get the number of PvDevice configurations available. More... | |
PvResult | GetDeviceName (uint32_t aIndex, PvString &aName) |
Get the configuration name (PvDevice). More... | |
PvResult | Restore (const PvString &aName, PvDevice *aDevice) |
Apply a configuration. More... | |
PvResult | Restore (uint32_t aIndex, PvDevice *aDevice) |
Apply a configuration to a PvDevice. More... | |
uint32_t | GetStreamCount () |
Get the number of stream configuration in this PvConfigurationReader. More... | |
PvResult | GetStreamName (uint32_t aIndex, PvString &aName) |
Get the configuration name (PvStream). More... | |
PvResult | Restore (const PvString &aName, PvStream *aStream) |
Apply a configuration to a PvStream. More... | |
PvResult | Restore (uint32_t aIndex, PvStream *Stream) |
Apply a configuration to a PvStream. More... | |
uint32_t | GetStringCount () |
Get the number of custom-state strings in the configuration file. More... | |
PvResult | GetStringName (uint32_t aIndex, PvString &aName) |
Get the custom-state string name (PvString) More... | |
PvResult | Restore (const PvString &aKey, PvString &aValue) |
Apply a configuration. More... | |
PvResult | Restore (uint32_t aIndex, PvString &aValue) |
Apply a configuration. More... | |
uint32_t | GetGenParameterArrayCount () |
Get the number of PvGenParameterArray objects saved in the configuration file. More... | |
PvResult | GetGenParameterArrayName (uint32_t aIndex, PvString &aName) |
Get the configuration name (PvGenParameterArray). More... | |
PvResult | Restore (const PvString &aKey, PvGenParameterArray *aParameterArray) |
Apply a configuration to a PvGenParameterArray. More... | |
PvResult | Restore (uint32_t aIndex, PvGenParameterArray *aParameterArray) |
Apply a configuration to a PvGenParameterArray. More... | |
uint32_t | GetPropertyListCount () |
Get the number of PvPropertyList objects saved in the configuration file. More... | |
PvResult | GetPropertyListName (uint32_t aIndex, PvString &aName) |
Get the configuration name (PvPropertyList). More... | |
PvResult | Restore (const PvString &aKey, PvPropertyList *aPropertyList) |
Retrieves the data to a PvPropertyList. More... | |
PvResult | Restore (uint32_t aIndex, PvPropertyList *aPropertyList) |
Retrieves the data to a PvPropertyList. More... | |
void | SetErrorList (PvStringList *aList, const PvString &aPrefix) |
Sets the error list where all errors/warnings are logged. More... | |
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 | ( | ) |
Get the number of PvDevice configurations available.
This family of methods returns the number of configurations in a configuration file. The methods include:
Get the configuration name (PvDevice).
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 | ( | ) |
Get the number of PvGenParameterArray objects saved in the configuration file.
See GetDeviceCount.
Get the configuration name (PvGenParameterArray).
See GetDeviceName.
[in] | aIndex | See GetDeviceName. |
[out] | aName | See GetDeviceName. |
uint32_t PvConfigurationReader::GetPropertyListCount | ( | ) |
Get the number of PvPropertyList objects saved in the configuration file.
See GetDeviceCount.
Get the configuration name (PvPropertyList).
See GetDeviceName.
[in] | aIndex | See GetDeviceName. |
[out] | aName | See GetDeviceName. |
uint32_t PvConfigurationReader::GetStreamCount | ( | ) |
Get the number of stream configuration in this PvConfigurationReader.
See GetDeviceCount.
Get the configuration name (PvStream).
See GetDeviceName.
[in] | aIndex | See GetDeviceName. |
[out] | aName | See GetDeviceName. |
uint32_t PvConfigurationReader::GetStringCount | ( | ) |
Get the number of custom-state strings in the configuration file.
See GetDeviceCount.
Get the custom-state string name (PvString)
See GetDeviceName.
[in] | aIndex | See GetDeviceName. |
[out] | aName | See GetDeviceName. |
Load a configuration file from disk.
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 a configuration from a string.
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 | ||
) |
Apply a configuration to a PvGenParameterArray.
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 | ||
) |
Retrieves the data to a PvPropertyList.
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 |
Apply a configuration.
See Restore(const PvString&,PvDevice*).
[in] | aName | See Restore(const PvString&,PvDevice*). |
[out] | aString | See Restore(const PvString&,PvDevice*), aDevice parameter. |
Apply a configuration.
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). |
Apply a configuration to a PvStream.
See Restore(const PvString&,PvDevice*).
[in] | aName | See Restore(const PvString&,PvDevice*). |
[out] | aStream | See Restore(const PvString&,PvDevice*), aDevice parameter. |
Apply a configuration to a PvDevice.
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 | ||
) |
Apply a configuration to a PvGenParameterArray.
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 | ||
) |
Retrieves the data to a PvPropertyList.
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 |
Apply a configuration to a PvStream.
See Restore(uint32_t,PvDevice*).
[in] | aIndex | See Restore(uint32_t,PvDevice*). |
[out] | aStream | See Restore(uint32_t,PvDevice*), aDevice parameter. |
Apply a configuration.
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 where all errors/warnings are logged.
[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-2021 Pleora Technologies Inc.
www.pleora.com