|
| | PopulateConfig ()=delete |
| | Do not allow construction with no arguments.
|
| |
| | PopulateConfig (const PopulateConfig &)=delete |
| | This class cannot be copy constructed.
|
| |
| PopulateConfig & | operator= (const PopulateConfig &)=delete |
| | This class cannot be copy assigned.
|
| |
| | PopulateConfig (PopulateConfig &&)=default |
| | Objects of this class can be moved.
|
| |
| PopulateConfig & | operator= (PopulateConfig &&)=default |
| | Objects of this class can be moved with the move assignment operator.
|
| |
| | PopulateConfig (PersistentRepoIf &source, RuntimeRepoIf &target) |
| | Constructs the utility class with references to the repositories that should be used.
|
| |
| bool | IsDisablePopulateFlagSet (const std::string &rtc_supervisor) |
| | Checks if the disable_populate flag has been set for the RTC Supervisor.
|
| |
| bool | IsDisableValidateFlagSet (const std::string &rtc_supervisor) |
| | Checks if the disable_validate flag has been set for the RTC Supervisor.
|
| |
| void | ValidatePersistentRepository () const |
| | Perform various validation tests on the Persistent Configuration Repository.
|
| |
| void | ClearConfig () |
| | Wipes the contents of the Runtime Configuration Repository.
|
| |
| void | PrePopulateConfig (const std::string &active_deployment_set) |
| | Performs a minimal, partial population of the Runtime Configuration Repository.
|
| |
| void | PopulateRuntimeRepo (StopToken stop_token, const std::map< std::string, std::string > &requested_modes) |
| | Populates the Runtime Configuration Repository.
|
| |
| void | CopyActiveDeploymentSet () |
| | Copies the active Deployment Set to the Runtime Configuration Repository.
|
| |
| std::multimap< std::string, std::string > | GetAvailableModes () const |
| | Returns available modes for the active deployment set.
|
| |
| std::map< std::string, std::string > | GetDefaultModes () const |
| | Returns default modes for the active deployment set.
|
| |
| std::map< std::string, std::string > | GetActiveModes () |
| | Returns active modes for the active deployment set.
|
| |
| void | ValidateRequestedModes (const std::map< std::string, std::string > &requested_modes) const |
| | Performs input validation for requested_modes.
|
| |
| void | CopyRequestedModes (const std::map< std::string, std::string > &requested_modes) |
| | Apply requested modes by copying datapoints from source to target repository.
|
| |
| void | CopyHierarchy (const DataPointPath &source, const DataPointPath &target) |
| | Copy a hierarchy of datapoints from the source to the target repository.
|
| |
| void | CopyDataPoint (const DataPointPath &source, const DataPointPath &target) |
| | Copy a single datapoint from the source to the target repository.
|
| |
| void | ValidateWriteBack (const std::vector< DataPointPath > &datapoints) |
| | Performs additional input validation for the WriteBack method.
|
| |
| void | WriteBack (StopToken stop, const std::vector< DataPointPath > &datapoints) |
| | Performs the a writeback operation.
|
| |
A utility class used to populate the Runtime Configuration Repository.
This implements relevant logic to interpret the persistent configuration information stored in the Persistent Configuration Repository and copy only the datapoints relevant for the runtime configuration to the target Runtime Configuration Repository.
An important goal of this class is to consolidate all logic relevant for the mechanics of populating the Runtime Configuration Repository into one class, rather than distribute the logic across different components. Therefore only some of the the public methods provided are applicable to the RTC Supervisor for example, while others are applicable to the Deployment Daemon.
- Thread Safety
- thread-compatible – The copy methods require synchronisation.
| void rtctk::componentFramework::PopulateConfig::CopyActiveDeploymentSet |
( |
| ) |
|
Copies the active Deployment Set to the Runtime Configuration Repository.
This will populate the target Runtime Configuration Repository given in the constructor, by copying datapoints from the Persistent Configuration Repository for the active Deployment Set. The active Deployment Set is identified by the string stored in the datapoint /deployment/active_deployment. This must correspond to one of the sub-paths found in the root path /, i.e. one of the child folders of the root path.
All datapoints found under /{deployment}/defaults are copied to the root of the Runtime Configuration Repository, where {deployment} is the name of the active Deployment Set found in /deployment/active_deployment. The modes are then overlaid over the defaults, by effectively copying the datapoints found for each mode's option to the root of the Runtime Configuration Repository, instead of using the default datapoints. The modes for the active Deployment Set are searched for under the path /{deployment}/modes.
For each sub-path /{deployment}/modes/{name}, the default option is read from the string datapoint /{deployment}/modes/{name}/default_option. This should correspond to a sub-path under /{deployment}/modes/{name}. If the default option datapoint exists and is valid, all datapoints found under /{deployment}/modes/{name}/{option} are copied into the root of the Runtime Configuration Repository, where {option} is the value read from /{deployment}/modes/{name}/default_option. This will replace some of the default values initially loaded from /{deployment}/defaults with the mode specific ones.
- Exceptions
-
- Thread Safety
- ❗thread-hostile❗ – Due to multiple requests to the underlying repositories.
- Exception Safety
- basic
| bool rtctk::componentFramework::PopulateConfig::IsDisablePopulateFlagSet |
( |
const std::string & | rtc_supervisor | ) |
|
Checks if the disable_populate flag has been set for the RTC Supervisor.
The disable_populate flag indicates if automated populating of the Runtime Configuration Repository should be suppressed by the given RTC Supervisor instance. This method will first look for the boolean datapoint /{rtc_supervisor}/static/disable_populate in the Runtime Configuration Repository, where {rtc_supervisor} is the name of the RTC Supervisor instance. If this datapoint exists, its value is returned. Otherwise the datapoint /{deployment}/defaults/{rtc_supervisor}/static/disable_populate is searched for in the active Deployment Set (indicated by the {deployment} placeholder) in the Persistent Configuration Repository. If the datapoint exists in the Persistent Configuration Repository instead, then that value is returned. However, if a datapoint cannot be found in either repository then a default value of false is returned.
This logic is part of PopulateConfig, since this class is responsible for identifying the configuration entries in the Persistent Configuration Repository for the active Deployment Set. Knowing the exact location of this flag for the active Deployment Set therefore requires similar logic.
- Parameters
-
| [in] | rtc_supervisor | The name of the RTC Supervisor instance who's flag to check. |
- Returns
true if the flag was set and false if it was not or the datapoint for the flag does not exist in the repository.
- Thread Safety
- thread-safe
- Exception Safety
- strong
| bool rtctk::componentFramework::PopulateConfig::IsDisableValidateFlagSet |
( |
const std::string & | rtc_supervisor | ) |
|
Checks if the disable_validate flag has been set for the RTC Supervisor.
The disable_validate flag indicates if validation of the contents of the Persistent Configuration Repository should be suppressed by the given RTC Supervisor instance. This method will first look for the boolean datapoint /{rtc_supervisor}/static/disable_validate in the Runtime Configuration Repository, where {rtc_supervisor} is the name of the RTC Supervisor instance. If this datapoint exists, its value is returned. Otherwise the datapoint /{deployment}/defaults/{rtc_supervisor}/static/disable_validate is searched for in the active Deployment Set (indicated by the {deployment} placeholder) in the Persistent Configuration Repository. If the datapoint exists in the Persistent Configuration Repository instead, then that value is returned. However, if a datapoint cannot be found in either repository then a default value of false is returned.
Note that the logic and motivation for this method are similar to IsDisablePopulateFlagSet.
- Parameters
-
| [in] | rtc_supervisor | The name of the RTC Supervisor instance who's flag to check. |
- Returns
true if the flag was set and false if it was not or the datapoint for the flag does not exist in the repository.
- Thread Safety
- thread-safe
- Exception Safety
- strong