Used to calculate URIs from datapoint paths.
More...
#include <pathMapper.hpp>
Used to calculate URIs from datapoint paths.
This class is used to map datapoint paths to full URIs that can be used with the CII configuration service by PersistentRepoAdapter.
◆ PathMapper()
rtctk::componentFramework::PathMapper::PathMapper |
( |
const elt::mal::Uri & |
baseuri, |
|
|
bool |
simple_layout = false |
|
) |
| |
Constructs the mapper object with base URI and format flag.
- Parameters
-
[in] | baseuri | The base URI of the repository being mapped. |
[in] | simple_layout | A boolean flag indicating if the repository is using a simple layout or not. The simple repository layout means that no deployment sets are present and the repository represents a 1-to-1 copy of the Runtime Configuration Repository. |
◆ GetBasePath()
const std::filesystem::path& rtctk::componentFramework::PathMapper::GetBasePath |
( |
| ) |
const |
|
inline |
Get the base path for the repository.
- Returns
- The path component (interpreted as a filesystem path) of the base URI originally given to the constructor.
◆ GetBaseUri()
const elt::mal::Uri& rtctk::componentFramework::PathMapper::GetBaseUri |
( |
| ) |
const |
|
inline |
- Returns
- The base URI originally given to the constructor.
◆ GetSimpleLayout()
bool rtctk::componentFramework::PathMapper::GetSimpleLayout |
( |
| ) |
const |
|
inline |
- Returns
- The flag indicating if the simple repository layout should be used.
◆ PathToFile()
Maps a datapoint path to the corresponding local filesystem path.
This calculates what the local filesystem path for the YAML file should be that corresponds to the given datapoint path. The path component of the repository base URI is used for this calculation. This method is therefore only applicable to URIs with certain schemes, such as file:. Similarly to PathToUri, the ordered list of dictionary keys is also calculated and returned.
- Parameters
-
[in] | path | The logical datapoint path to map. |
- Returns
- A structure containing the YAML file path and the list of dictionary key names.
◆ PathToUri()
Maps a datapoint path to the corresponding URI.
This calculates what the document URI should be that corresponds to the given datapoint path, taking into account the base URI. The dictionary keys that are needed to identify the datapoint within the document are also returned as an ordered list. These are used to recursively traverse the tree structure formed by the nested dictionaries to find the leaf node that corresponds to the actual datapoint value.
- Parameters
-
[in] | path | The logical datapoint path to map. |
- Returns
- A structure containing the calculated URI and the list of dictionary key names.
◆ SetSimpleLayout()
void rtctk::componentFramework::PathMapper::SetSimpleLayout |
( |
bool |
simple_layout | ) |
|
|
inline |
Sets the flag that indicates if the simple repository layout should be used.
The simple repository layout means that no deployment sets are present and the repository represents a 1-to-1 copy of the Runtime Configuration Repository.
- Parameters
-
[in] | simple_layout | The flag boolean value. |
◆ SplitPathComponents()
std::vector< std::string > rtctk::componentFramework::PathMapper::SplitPathComponents |
( |
const DataPointPath & |
path | ) |
|
|
static |
Splits the datapoint path into a list of individual path components.
The path is split on the '/' path separator character.
- Parameters
-
[in] | path | The logical datapoint path to split. |
- Returns
- An ordered list of the datapoint path components as strings.
The documentation for this class was generated from the following files:
- componentFramework/services/persistentRepo/src/include/rtctk/componentFramework/pathMapper.hpp
- componentFramework/services/persistentRepo/src/pathMapper.cpp