RTC Toolkit  2.0.0
Classes | Public Types | Public Member Functions | List of all members
rtctk::rtcSupervisor::PopulateConfig Class Reference

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...
 
PopulateConfigoperator= (const PopulateConfig &)=delete
 This class cannot be copy assigned. More...
 
 PopulateConfig (PopulateConfig &&)=default
 Objects of this class can be moved. More...
 
PopulateConfigoperator= (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...
 

Detailed Description

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.

Thread Safety
thread-compatible – The copy methods require synchronisation.

Member Typedef Documentation

◆ DataPointPath

◆ PersistentRepoIf

◆ RuntimeRepoIf

Constructor & Destructor Documentation

◆ PopulateConfig() [1/4]

rtctk::rtcSupervisor::PopulateConfig::PopulateConfig ( )
delete

Do not allow construction with no arguments.

◆ PopulateConfig() [2/4]

rtctk::rtcSupervisor::PopulateConfig::PopulateConfig ( const PopulateConfig )
delete

This class cannot be copy constructed.

◆ PopulateConfig() [3/4]

rtctk::rtcSupervisor::PopulateConfig::PopulateConfig ( PopulateConfig &&  )
default

Objects of this class can be moved.

◆ PopulateConfig() [4/4]

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.

Parameters
[in]sourceThe Persistent Configuration Repository that stores the Deployment Set information.
[in]targetThe Runtime Configuration Repository that will be updated with the runtime configuration.

Member Function Documentation

◆ CopyActiveDeploymentSet()

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.

Note
It is possible to disable full Deployment Set handling with modes and force a simple 1-to-1 copying of all the datapoints in the Persistent Configuration Repository by setting the datapoint /simple_populate_runtime_repo to true.
Exceptions
InvalidConfigExceptionIf invalid configuration values are detected.
Thread Safety
thread-hostile❗ – Due to multiple requests to the underlying repositories.
Exception Safety
basic

◆ CopyDataPoint()

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.

Parameters
[in]sourceThe datapoint path in the Persistent Configuration Repository to copy from.
[in]targetThe datapoint path in the Runtime Configuration Repository to copy to.
Thread Safety
thread-hostile❗ – Due to multiple requests to the underlying repositories.
Exception Safety
basic

◆ CopyHierarchy()

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.

Parameters
[in]sourceThe datapoint path in the Persistent Configuration Repository to copy from.
[in]targetThe datapoint path in the Runtime Configuration Repository to copy to.
Thread Safety
thread-hostile❗ – Due to multiple requests to the underlying repositories.
Exception Safety
basic

◆ IsDisablePopulateFlagSet()

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.

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

◆ IsSimplePopulateFlagSet()

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.

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

◆ operator=() [1/2]

PopulateConfig& rtctk::rtcSupervisor::PopulateConfig::operator= ( const PopulateConfig )
delete

This class cannot be copy assigned.

◆ operator=() [2/2]

PopulateConfig& rtctk::rtcSupervisor::PopulateConfig::operator= ( PopulateConfig &&  )
default

Objects of this class can be moved with the move assignment operator.


The documentation for this class was generated from the following files: