ADTF
Loading...
Searching...
No Matches
ddl::utility Namespace Reference

definition of the utility namespace More...

Classes

class  IInfo
 Basic Info interface can be added to the ddl::dd::datamodel::InfoMap. More...
 
class  Info
 Helper template class to create valid IInfo objects. More...
 
class  InfoMap
 Info Map for the datamodel to hold a set of optional IInfo instances. Only one instance of one Info type is possible. More...
 
class  ModelObserverUtility
 The ModelObserver utility template. More...
 
class  ModelSubjectUtility
 Model Subject utility to define a Model Subject that notifies one or more observers. More...
 
struct  Optional
 An optional template as long as the std::optional is not available here. More...
 
class  TypeAccessList
 Bug fix class for ddl::dd::utility::TypeAccessList to get rid of providing getNamedItemList in validator. More...
 
class  TypeAccessMap
 Utility class for observable named items where the order is NOT important. More...
 
class  TypeAccessVector
 Utility class for observable named items where the order is important. More...
 
struct  VersionRequirement
 VersionRequirement to report a Version requirement. More...
 

Typedefs

template<typename T>
using TypeAccessListSubject = ModelSubjectUtility<T, TypeAccessListEventCode>
 helper template to observe list content.
 
template<typename T>
using TypeAccessListObserver = ModelObserverUtility<T, TypeAccessListEventCode>
 helper template to observe list content.
 
using OptionalSize = Optional<size_t>
 
template<typename T>
using TypeAccessVectorSubject = ModelSubjectUtility<T, TypeAccessVectorEventCode>
 helper template to observe vector content.
 
template<typename T>
using TypeAccessVectorObserver = ModelObserverUtility<T, TypeAccessVectorEventCode>
 helper template to observe vector content.
 
using Error = ::ddl::dd::Error
 Exception helper class to collect information while parsing, adding DD Objects or other failed operatons.
 
using Problem = ::ddl::dd::Problem
 Problem to report to find the corresponding item name in a simple way.
 
template<typename T>
using TypeAccessMapObserver
 helper template to observe map content.
 
template<typename T>
using TypeAccessMapSubject
 helper template to observe map content.
 

Enumerations

enum  TypeAccessVectorEventCode {
  vector_item_added , vector_item_removed , vector_item_changed , vector_item_renamed ,
  vector_subitem_added , vector_subitem_removed , vector_subitem_changed , vector_item_popped ,
  vector_subitem_popped , vector_item_inserted , vector_subitem_inserted , vector_subitem_renamed ,
  vector_item_removing , vector_subitem_removing , vector_item_renaming , vector_subitem_renaming
}
 Internal event code to inform the parent DD Object about the change of an item within the list. More...
 
enum  TypeAccessListEventCode
 Internal event code to inform the parent DD Object about the change of an item within the list. More...
 
enum  TypeAccessMapEventCode
 Internal event code to inform the parent DD Object about the change of an item within the list. More...
 

Functions

Optional< int > toType (const std::string &from_string, const Optional< int > &default_value={})
 specialized conversion to the Optional<int>
 
Optional< size_t > toType (const std::string &from_string, const utility::Optional< size_t > &default_value={})
 specialized conversion to the Optional<size_t>
 
Optional< std::string > toType (const std::string &from_string, const utility::Optional< std::string > &default_value={})
 specialized function to convert a string to an optional string which is only valid if set.
 
void replaceInString (std::string &string_data, const std::string &to_replace, const std::string &replace_with)
 In place replacement helper function.
 
std::vector< std::string > transformProblemList (const std::vector< Problem > &problems)
 transforms the Problem List to a simple vector of strings.
Simple usage:
 
bool isInteger (const std::string &string_to_check) noexcept
 Checks if the given string is an integer value.
 

Detailed Description

definition of the utility namespace

Typedef Documentation

◆ Error

Exception helper class to collect information while parsing, adding DD Objects or other failed operatons.

◆ OptionalSize

optional size definition.

◆ Problem

Problem to report to find the corresponding item name in a simple way.

◆ TypeAccessListObserver

helper template to observe list content.

Remarks
for internal use only.
Template Parameters
Tthe subject class to observe

◆ TypeAccessListSubject

helper template to observe list content.

Remarks
for internal use only.
Template Parameters
Tthe subject class to observe

◆ TypeAccessMapObserver

template<typename T>
using ddl::dd::utility::TypeAccessMapObserver

helper template to observe map content.

Remarks
for internal use only.
Template Parameters
Tthe subject class to observe

◆ TypeAccessMapSubject

template<typename T>
using ddl::dd::utility::TypeAccessMapSubject

helper template to observe map content.

Remarks
for internal use only.
Template Parameters
Tthe subject class to observe

◆ TypeAccessVectorObserver

helper template to observe vector content.

Remarks
for internal use only.
Template Parameters
Tthe subject class to observe

◆ TypeAccessVectorSubject

helper template to observe vector content.

Remarks
for internal use only.
Template Parameters
Tthe subject class to observe

Enumeration Type Documentation

◆ TypeAccessListEventCode

Internal event code to inform the parent DD Object about the change of an item within the list.

Remarks
for internal use only. The user API will use ddl::dd::datamodel::ModelEventCode only.

◆ TypeAccessMapEventCode

Internal event code to inform the parent DD Object about the change of an item within the list.

Remarks
for internal use only. The user API will use ddl::dd::datamodel::ModelEventCode only.

◆ TypeAccessVectorEventCode

Internal event code to inform the parent DD Object about the change of an item within the list.

Remarks
for internal use only. The user API will use ddl::dd::datamodel::ModelEventCode only.

Function Documentation

◆ isInteger()

bool ddl::dd::utility::isInteger ( const std::string & string_to_check)
noexcept

Checks if the given string is an integer value.

Parameters
[in]string_to_checkthe string to check
Returns
true/false

◆ replaceInString()

void ddl::utility::replaceInString ( std::string & string_data,
const std::string & to_replace,
const std::string & replace_with )

In place replacement helper function.

Parameters
string_datathe string data to replace in
to_replacethe string to replace
replace_withthe string to replace with

◆ toType() [1/3]

Optional< int > ddl::utility::toType ( const std::string & from_string,
const Optional< int > & default_value = {} )

specialized conversion to the Optional<int>

Parameters
from_stringstring representation of the value
default_valuethe optional value to set if not set in from_string
Returns
utility::Optional<int>

◆ toType() [2/3]

Optional< size_t > ddl::utility::toType ( const std::string & from_string,
const utility::Optional< size_t > & default_value = {} )

specialized conversion to the Optional<size_t>

Parameters
from_stringstring representation of the value
default_valuethe optional value to set if not set in from_string
Returns
utility::Optional<size_t>

◆ toType() [3/3]

Optional< std::string > ddl::utility::toType ( const std::string & from_string,
const utility::Optional< std::string > & default_value = {} )

specialized function to convert a string to an optional string which is only valid if set.

Parameters
from_stringthe string to convert from
default_valuethe optional value to set if from_string is empty
Returns
utility::Optional<std::string>

◆ transformProblemList()

std::vector< std::string > ddl::dd::transformProblemList ( const std::vector< Problem > & problems)

transforms the Problem List to a simple vector of strings.
Simple usage:

//...
using namespace ddl;
//... adding ... loading ... using
std::cout <<
The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::data...
Definition dd.h:92
std::vector< ddl::dd::Problem > getValidationProtocol() const
Gets a collection of all problems obtained while validating the DataDefinition Objects.
std::string join(const std::vector< std::string > &strings, const std::string &delimiter)
std::vector< std::string > transformProblemList(const std::vector< Problem > &problems)
transforms the Problem List to a simple vector of strings. Simple usage:
definition of the ddl namespace
Definition codec.h:21
Parameters
problemsthe problems to tranform.
Returns
std::vector<std::string>