FrontPanel API 5.3.5
|
Represents the set of settings stored in the given device. More...
Public Member Functions | |
okCDeviceSettings ()=default | |
ErrorCode | GetString (const std::string &key, std::string *value) |
ErrorCode | GetInt (const std::string &key, UINT32 *value) |
ErrorCode | SetString (const std::string &key, const std::string &value) |
ErrorCode | SetInt (const std::string &key, UINT32 value) |
ErrorCode | List (std::vector< std::string > &keys) |
ErrorCode | Delete (const std::string &key) |
ErrorCode | Save () |
A device settings object is always associated with a device and although multiple setting objects can be created for the same device, all of them manipulate the same set of settings, so usually there should be only a single one of them.
All methods of this class return an error code to indicate success or failure which should be checked by caller, no exceptions are thrown. In particular, until the device settings object was successfully initialized by calling okCFrontPanel::GetDeviceSettings(), all methods return InvalidParameter error.
Example:
|
default |
Default constructor creates an uninitialized object of this class.
Use okCFrontPanel::GetDeviceSettings() to initialize it.
|
inline |
[in] | key | - Device setting name to delete. |
Deletes a setting from the setting store.
|
inline |
[in] | key | - Device setting name. |
[out] | value | - Returned device setting value. |
Retrieve an integer setting value by its name.
|
inline |
[in] | key | - Device setting name. |
[out] | value | - Returned device setting value. |
Retrieve a string setting value by its name.
|
inline |
[out] | keys | - A vector of string names of all keys stored on the device. |
This API clears the parameter keys, then fills it with a complete list of all persistent settings on the device. Note that this method will not list non-persistent settings. For a list of non-persistent settings, please see the appropriate device User's Manual.
|
inline |
Commits the setting store to non-volatile storage. All setting updates (including delete) are performed in volatile memory on the device until they are committed to NVRAM with this call. The next power cycle will restore NVRAM settings to memory.
|
inline |
[in] | key | - Device setting name. |
[in] | value | - New setting value. |
Set an integer setting value.
|
inline |
[in] | key | - Device setting name. |
[in] | value | - New setting value. |
Set a string setting value.