RTC Toolkit
2.0.0
|
A utility class used to populate the Runtime Configuration Repository. More...
#include <populateConfig.hpp>
Classes | |
class | InvalidConfigException |
The InvalidConfigException is thrown when datapoints in the Persistent Configuration Repository are discovered to have invalid values. More... | |
Public Types | |
using | DataPointPath = componentFramework::DataPointPath |
using | PersistentRepoIf = componentFramework::PersistentRepoIf |
using | RuntimeRepoIf = componentFramework::RuntimeRepoIf |
Public Member Functions | |
PopulateConfig ()=delete | |
Do not allow construction with no arguments. More... | |
PopulateConfig (const PopulateConfig &)=delete | |
This class cannot be copy constructed. More... | |
PopulateConfig & | operator= (const PopulateConfig &)=delete |
This class cannot be copy assigned. More... | |
PopulateConfig (PopulateConfig &&)=default | |
Objects of this class can be moved. More... | |
PopulateConfig & | operator= (PopulateConfig &&)=default |
Objects of this class can be moved with the move assignment operator. More... | |
PopulateConfig (const PersistentRepoIf &source, RuntimeRepoIf &target) | |
Constructs the utility class with references to the repositories that should be used. More... | |
bool | IsDisablePopulateFlagSet () |
Checks if the disable_populate_runtime_repo flag has been set. More... | |
bool | IsSimplePopulateFlagSet () |
Checks if the simple_populate_runtime_repo flag has been set. More... | |
void | CopyActiveDeploymentSet () |
Copies the active Deployment Set to the Runtime Configuration Repository. More... | |
void | CopyHierarchy (const DataPointPath &source, const DataPointPath &target) |
Copy a hierarchy of datapoints from the source to the target repository. More... | |
void | CopyDataPoint (const DataPointPath &source, const DataPointPath &target) |
Copy a single datapoint from the source to the target repository. More... | |
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.
|
delete |
Do not allow construction with no arguments.
|
delete |
This class cannot be copy constructed.
|
default |
Objects of this class can be moved.
rtctk::rtcSupervisor::PopulateConfig::PopulateConfig | ( | const PersistentRepoIf & | source, |
RuntimeRepoIf & | target | ||
) |
Constructs the utility class with references to the repositories that should be used.
The source and target repository must be specified. The source repository must be the Persistent Configuration Repository from which Deployment Set data will be read. The target repository must be the Runtime Configuration Repository to which the relevant runtime configuration datapoints will be copied.
[in] | source | The Persistent Configuration Repository that stores the Deployment Set information. |
[in] | target | The Runtime Configuration Repository that will be updated with the runtime configuration. |
void rtctk::rtcSupervisor::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 /active_deployment
. This must correspond to a sub-path 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 found in /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 with the mode specific ones.
/simple_populate_runtime_repo
to true
.InvalidConfigException | If invalid configuration values are detected. |
void rtctk::rtcSupervisor::PopulateConfig::CopyDataPoint | ( | const DataPointPath & | source, |
const DataPointPath & | target | ||
) |
Copy a single datapoint from the source to the target repository.
Copies a datapoint indicated by the source path from the source Persistent Configuration Repository, as set in the constructor, to the target path and target Runtime Configuration Repository.
[in] | source | The datapoint path in the Persistent Configuration Repository to copy from. |
[in] | target | The datapoint path in the Runtime Configuration Repository to copy to. |
void rtctk::rtcSupervisor::PopulateConfig::CopyHierarchy | ( | const DataPointPath & | source, |
const DataPointPath & | target | ||
) |
Copy a hierarchy of datapoints from the source to the target repository.
Copies an entire hierarchy of datapoints indicated by the source path from the source Persistent Configuration Repository, as set in the constructor, to the target path and target Runtime Configuration Repository.
[in] | source | The datapoint path in the Persistent Configuration Repository to copy from. |
[in] | target | The datapoint path in the Runtime Configuration Repository to copy to. |
bool rtctk::rtcSupervisor::PopulateConfig::IsDisablePopulateFlagSet | ( | ) |
Checks if the disable_populate_runtime_repo
flag has been set.
The disable_populate_runtime_repo
flag indicates if automated populating of the Runtime Configuration Repository should be suppressed by the RTC Supervisor. The corresponding Persistent Configuration Repository datapoint is /disable_populate_runtime_repo
.
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.
true
if the flag was set and false
if it was not or the datapoint for the flag does not exist in the repository.bool rtctk::rtcSupervisor::PopulateConfig::IsSimplePopulateFlagSet | ( | ) |
Checks if the simple_populate_runtime_repo
flag has been set.
The simple_populate_runtime_repo
flag indicates if the CopyActiveDeploymentSet
method will perform a simple 1-to-1 copy of the Persistent Configuration Repository or if the Deployment Sets should be properly handled, in which case it is no longer a simple copy. The corresponding Persistent Configuration Repository datapoint is /simple_populate_runtime_repo
.
true
if the flag was set and false
if it was not or the datapoint for the flag does not exist in the repository.
|
delete |
This class cannot be copy assigned.
|
default |
Objects of this class can be moved with the move assignment operator.