Go to the source code of this file.
◆ option_usage_read_counter()
bool option_usage_read_counter |
( |
const char * |
option_name, |
|
|
unsigned long long * |
pCounter, |
|
|
const mysql_service_registry_t * |
registry |
|
) |
| |
A helper function to read the current value of a option usage counter.
Fetches a reference to the option_tracker service. Retrieves the usage JSON for the option, parses it, fetches the usedCounter field and stores it into the pointer passed. Then disposes of the reference.
Returns true if there's any error.
- Return values
-
- Parameters
-
| option_name | the name of the option to retrieve data for |
[out] | pCounter | the buffer to return the value into |
| registry | A reference to the registry service to use |
◆ option_usage_register_callback()
Registers a cache update callback.
Call this to subscribe to persisted data updates
- Parameters
-
option_name | the name of the option to register a callback for |
cb | the callback function |
registry | A reference to the registry service to use |
- Return values
-
◆ option_usage_set_counter_from_json()
bool option_usage_set_counter_from_json |
( |
const mysql_service_registry_t * |
registry, |
|
|
const char * |
option_name, |
|
|
char * |
usage_data, |
|
|
unsigned long long * |
pCounter |
|
) |
| |
A helper function to parse a JSON string and extract the counter value.
Given the usage JSON for the option, parses it, fetches the usedCounter field and stores it into the pointer passed.
Returns true if there's any error.
- Return values
-
- Parameters
-
| registry | A reference to the registry service to use to put errors and warnings. can be null. |
| option_name | the name of the option that JSON usage is for |
| usage_data | a JSON string for the usage data |
[out] | pCounter | the buffer to return the value into |
◆ option_usage_unregister_callback()
Unregisters a cache update callback.
Call this to unsubscribe to persisted data updates
- Parameters
-
option_name | the name of the option to unregister a callback for |
cb | the callback function |
registry | A reference to the registry service to use |
- Return values
-