Compute Graph Framework SDK Reference
5.4.5418 Release
For Test and Development only

dw::framework::ParameterProvider Class Referenceabstract

Detailed Description

The interface to access parameter values identified by name and/or (semantic) type.

Definition at line 51 of file ParameterProvider.hpp.

Inheritance diagram for dw::framework::ParameterProvider:
dw::framework::TypeBasedParameterProvider

Public Member Functions

template<typename T , typename std::enable_if_t< !std::is_array< T >::value &&!std::is_enum< T >::value > * = nullptr>
bool get (dw::core::StringView const &key, T *out) const
 Get a non-array non-enum parameter value. More...
 
template<typename T , typename std::enable_if_t< !std::is_array< T >::value &&!std::is_enum< T >::value > * = nullptr>
bool get (dw::core::StringView const &key, size_t const index, T *out) const
 Get a single non-enum parameter value from an array parameter by index. More...
 
template<typename T , typename std::enable_if_t< !std::is_array< T >::value &&!std::is_enum< T >::value > * = nullptr>
bool get (dw::core::StringView const &key, std::vector< T > *out) const
 Get a vector of non-enum parameter values. More...
 
template<typename T , typename std::enable_if_t< std::is_array< T >::value &&std::rank< T >::value==1 &&!std::is_enum< std::remove_extent_t< T >>::value > * = nullptr>
bool get (dw::core::StringView const &key, T *out) const
 Get a fixed-size 1 dimension array of non-enum parameter values. More...
 
template<typename T , typename std::enable_if_t< std::is_array< T >::value &&std::rank< T >::value==1 &&std::is_same< T, char8_t >::value > * = nullptr>
bool get (dw::core::StringView const &key, T *out) const
 Get a fixed-size 1 dimension array of non-enum parameter values of type char8_t. More...
 
template<typename T , typename std::enable_if_t< std::is_array< T >::value &&std::rank< T >::value==2 &&!std::is_enum< std::remove_all_extents_t< T >>::value > * = nullptr>
bool get (dw::core::StringView const &key, T *out) const
 Get a fixed-size 2 dimension array of non-enum parameter values. More...
 
template<typename S , typename T , std::enable_if_t<!std::is_enum< T >::value > * = nullptr>
bool get (dw::core::StringView const &key, T *out) const
 Get a non-enum parameter value with a semantic type. More...
 
template<typename S , typename T , size_t N, std::enable_if_t< std::is_same< T, dw::core::FixedString< N >>::value > * = nullptr>
bool get (dw::core::StringView const &key, dw::core::FixedString< N > *out) const
 Get a FixedString parameter value with a semantic type. More...
 
template<typename S , typename T , std::enable_if_t< std::is_enum< T >::value > * = nullptr>
bool get (dw::core::StringView const &key, T *out) const
 Get an enum parameter value with a semantic type. More...
 
template<typename S , typename T , std::enable_if_t<!std::is_enum< T >::value > * = nullptr>
bool get (dw::core::StringView const &key, size_t const index, T *out) const
 Get a non-enum parameter value with a semantic type from an array parameter by index. More...
 
template<typename S , typename T , size_t N, std::enable_if_t< std::is_same< T, dw::core::FixedString< N >>::value > * = nullptr>
bool get (dw::core::StringView const &key, size_t const index, dw::core::FixedString< N > *out) const
 Get a FixedString parameter value with a semantic type from an array parameter by index. More...
 
template<typename S , typename T , std::enable_if_t< std::is_enum< T >::value > * = nullptr>
bool get (dw::core::StringView const &key, size_t const index, T *out) const
 Get an enum parameter value with a semantic type from an array parameter by index. More...
 
virtual bool get (ParameterProvider const *const parentProvider, dw::core::StringView const &key, const std::type_info &semanticTypeInfo, const std::type_info &dataTypeInfo, void *out) const =0
 Get a parameter. More...
 
virtual bool get (ParameterProvider const *const parentProvider, dw::core::StringView const &key, size_t const index, const std::type_info &semanticTypeInfo, const std::type_info &dataTypeInfo, void *out) const =0
 Get a parameter value from an array parameter by index. More...
 
template<typename T >
bool getOptional (dw::core::StringView const &key, T *out) const
 Convenience API throwing an exception instead of returning a failed status. More...
 
template<typename T >
bool getOptional (dw::core::StringView const &key, size_t const index, T *out) const
 Convenience API throwing an exception instead of returning a failed status. More...
 
template<typename S , typename T >
bool getOptional (dw::core::StringView const &key, T *out) const
 Convenience API throwing an exception instead of returning a failed status. More...
 
template<typename S , typename T >
bool getOptional (dw::core::StringView const &key, size_t const index, T *out) const
 Convenience API throwing an exception instead of returning a failed status. More...
 
template<typename T >
void getRequired (dw::core::StringView const &key, T *out) const
 Convenience API throwing an exception instead of returning false. More...
 
template<typename T >
void getRequired (dw::core::StringView const &key, size_t const index, T *out) const
 Convenience API throwing an exception instead of returning false. More...
 
template<typename S , typename T >
void getRequired (dw::core::StringView const &key, T *out) const
 Convenience API throwing an exception instead of returning false. More...
 
template<typename S , typename T >
void getRequired (dw::core::StringView const &key, size_t const index, T *out) const
 Convenience API throwing an exception instead of returning false. More...
 
 ParameterProvider ()=default
 Default constructor. More...
 
virtual ~ParameterProvider ()=default
 Destructor. More...
 

Protected Member Functions

ParameterProvideroperator= (ParameterProvider const &)=default
 Copy assignment operator. More...
 
ParameterProvideroperator= (ParameterProvider &&)=default
 Move assignment operator. More...
 
 ParameterProvider (ParameterProvider const &)=default
 Copy constructor. More...
 
 ParameterProvider (ParameterProvider &&)=default
 Move constructor. More...
 

Constructor & Destructor Documentation

◆ ParameterProvider() [1/3]

dw::framework::ParameterProvider::ParameterProvider ( ParameterProvider const &  )
protecteddefault

Copy constructor.

◆ ParameterProvider() [2/3]

dw::framework::ParameterProvider::ParameterProvider ( ParameterProvider &&  )
protecteddefault

Move constructor.

◆ ParameterProvider() [3/3]

dw::framework::ParameterProvider::ParameterProvider ( )
default

Default constructor.

◆ ~ParameterProvider()

virtual dw::framework::ParameterProvider::~ParameterProvider ( )
virtualdefault

Destructor.

Member Function Documentation

◆ get() [1/14]

template<typename T , typename std::enable_if_t< !std::is_array< T >::value &&!std::is_enum< T >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
T *  out 
) const
inline

Get a non-array non-enum parameter value.

See also
get(ParameterProvider const* const, dw::core::StringView const&, const std::type_info&, const std::type_info&, T*)

Definition at line 147 of file ParameterProvider.hpp.

◆ get() [2/14]

template<typename T , typename std::enable_if_t< !std::is_array< T >::value &&!std::is_enum< T >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
size_t const  index,
T *  out 
) const
inline

Get a single non-enum parameter value from an array parameter by index.

See also
get(ParameterProvider const* const, dw::core::StringView const&, const std::type_info&, const std::type_info&, size_t const, T*)

Definition at line 162 of file ParameterProvider.hpp.

◆ get() [3/14]

template<typename T , typename std::enable_if_t< !std::is_array< T >::value &&!std::is_enum< T >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
std::vector< T > *  out 
) const
inline

Get a vector of non-enum parameter values.

See also
get(ParameterProvider const* const, dw::core::StringView const&, const std::type_info&, const std::type_info&, T*)

Definition at line 177 of file ParameterProvider.hpp.

◆ get() [4/14]

template<typename T , typename std::enable_if_t< std::is_array< T >::value &&std::rank< T >::value==1 &&!std::is_enum< std::remove_extent_t< T >>::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
T *  out 
) const
inline

Get a fixed-size 1 dimension array of non-enum parameter values.

See also
get(ParameterProvider const* const, std::vector<T>*)

Definition at line 193 of file ParameterProvider.hpp.

◆ get() [5/14]

template<typename T , typename std::enable_if_t< std::is_array< T >::value &&std::rank< T >::value==1 &&std::is_same< T, char8_t >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
T *  out 
) const
inline

Get a fixed-size 1 dimension array of non-enum parameter values of type char8_t.

See also
get(ParameterProvider const* const, std::vector<T>*)

Definition at line 228 of file ParameterProvider.hpp.

◆ get() [6/14]

template<typename T , typename std::enable_if_t< std::is_array< T >::value &&std::rank< T >::value==2 &&!std::is_enum< std::remove_all_extents_t< T >>::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
T *  out 
) const
inline

Get a fixed-size 2 dimension array of non-enum parameter values.

See also
get(ParameterProvider const* const, std::vector<T>*)

Definition at line 257 of file ParameterProvider.hpp.

◆ get() [7/14]

template<typename S , typename T , std::enable_if_t<!std::is_enum< T >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
T *  out 
) const
inline

Get a non-enum parameter value with a semantic type.

See also
get(ParameterProvider const* const, dw::core::StringView const&, const std::type_info&, const std::type_info&, T*)

Definition at line 372 of file ParameterProvider.hpp.

◆ get() [8/14]

template<typename S , typename T , size_t N, std::enable_if_t< std::is_same< T, dw::core::FixedString< N >>::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
dw::core::FixedString< N > *  out 
) const
inline

Get a FixedString parameter value with a semantic type.

See also
get(ParameterProvider const* const, dw::core::StringView const&, const std::type_info&, const std::type_info&, T*)

Definition at line 395 of file ParameterProvider.hpp.

◆ get() [9/14]

template<typename S , typename T , std::enable_if_t< std::is_enum< T >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
T *  out 
) const
inline

Get an enum parameter value with a semantic type.

The parameter value retrieved is of type string and is being mapped to the enum type output parameter.

See also
get(ParameterProvider const* const, dw::core::StringView const&, const std::type_info&, const std::type_info&, T*)

Definition at line 421 of file ParameterProvider.hpp.

References dw::framework::Exception::messageStr(), and dw::framework::Exception::status().

◆ get() [10/14]

template<typename S , typename T , std::enable_if_t<!std::is_enum< T >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
size_t const  index,
T *  out 
) const
inline

Get a non-enum parameter value with a semantic type from an array parameter by index.

See also
get(ParameterProvider const* const, dw::core::StringView const&, size_t const, const std::type_info&, const std::type_info&, T*)

Definition at line 453 of file ParameterProvider.hpp.

◆ get() [11/14]

template<typename S , typename T , size_t N, std::enable_if_t< std::is_same< T, dw::core::FixedString< N >>::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
size_t const  index,
dw::core::FixedString< N > *  out 
) const
inline

Get a FixedString parameter value with a semantic type from an array parameter by index.

See also
get(ParameterProvider const* const, dw::core::StringView const&, size_t const, const std::type_info&, const std::type_info&, T*)

Definition at line 466 of file ParameterProvider.hpp.

◆ get() [12/14]

template<typename S , typename T , std::enable_if_t< std::is_enum< T >::value > * = nullptr>
bool dw::framework::ParameterProvider::get ( dw::core::StringView const &  key,
size_t const  index,
T *  out 
) const
inline

Get an enum parameter value with a semantic type from an array parameter by index.

The parameter value retrieved is of type string and is being mapped to the enum type output parameter.

See also
get(ParameterProvider const* const, dw::core::StringView const&, size_t const, const std::type_info&, const std::type_info&, T*)

Definition at line 492 of file ParameterProvider.hpp.

References dw::framework::Exception::messageStr(), and dw::framework::Exception::status().

◆ get() [13/14]

virtual bool dw::framework::ParameterProvider::get ( ParameterProvider const *const  parentProvider,
dw::core::StringView const &  key,
const std::type_info &  semanticTypeInfo,
const std::type_info &  dataTypeInfo,
void *  out 
) const
pure virtual

Get a parameter.

Parameters
[in]parentProviderThe parent provider in case the lookup goes through a hierarchy of providers, otherwise nullptr
[in]keyThe parameter name, or an empty string if the (semantic) type sufficiently identifies the parameter
[in]semanticTypeInfoThe semantic type info of the parameter, which can be different from the data type info to handle parameters with the same data type differently
[in]dataTypeInfoThe type info of the parameter value
[out]outThe parameter value is returned here if true is returned
Returns
true if the requested parameter value was set in the out parameter, false if the requested parameter isn't available
Exceptions
ifthe requested parameter failed to be retrieved

Implemented in dw::framework::TypeBasedParameterProvider.

◆ get() [14/14]

virtual bool dw::framework::ParameterProvider::get ( ParameterProvider const *const  parentProvider,
dw::core::StringView const &  key,
size_t const  index,
const std::type_info &  semanticTypeInfo,
const std::type_info &  dataTypeInfo,
void *  out 
) const
pure virtual

Get a parameter value from an array parameter by index.

Parameters
[in]parentProviderThe parent provider in case the lookup goes through a hierarchy of providers, otherwise nullptr
[in]keyThe parameter name, or an empty string if the (semantic) type sufficiently identifies the parameter
[in]indexThe index of the value in the array parameter
[in]semanticTypeInfoThe semantic type info of the parameter, which can be different from the data type info to handle parameters with the same data type differently
[in]dataTypeInfoThe type info of the parameter value
[out]outThe parameter value is returned here if true is returned
Returns
true if the requested parameter value was set in the out parameter, false if the requested parameter isn't available
Exceptions
ifthe requested parameter failed to be retrieved

Implemented in dw::framework::TypeBasedParameterProvider.

◆ getOptional() [1/4]

template<typename T >
bool dw::framework::ParameterProvider::getOptional ( dw::core::StringView const &  key,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning a failed status.

See also
get(dw::core::StringView const&, T*)
Exceptions
Exceptionif the parameter retrieval has a failure

Definition at line 106 of file ParameterProvider.hpp.

References dw::framework::Exception::messageStr(), and dw::framework::Exception::status().

Referenced by dw::framework::describeParameters(), and getRequired().

◆ getOptional() [2/4]

template<typename T >
bool dw::framework::ParameterProvider::getOptional ( dw::core::StringView const &  key,
size_t const  index,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning a failed status.

See also
get(dw::core::StringView const&, size_t const, T*)
Exceptions
Exceptionif the parameter retrieval has a failure

Definition at line 125 of file ParameterProvider.hpp.

References dw::framework::Exception::messageStr(), and dw::framework::Exception::status().

◆ getOptional() [3/4]

template<typename S , typename T >
bool dw::framework::ParameterProvider::getOptional ( dw::core::StringView const &  key,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning a failed status.

See also
get(dw::core::StringView const&, T*)
Exceptions
Exceptionif the parameter retrieval has a failure

Definition at line 319 of file ParameterProvider.hpp.

References dw::framework::Exception::messageStr(), and dw::framework::Exception::status().

◆ getOptional() [4/4]

template<typename S , typename T >
bool dw::framework::ParameterProvider::getOptional ( dw::core::StringView const &  key,
size_t const  index,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning a failed status.

See also
get(dw::core::StringView const&, size_t const, T*)
Exceptions
Exceptionif the parameter retrieval has a failure

Definition at line 345 of file ParameterProvider.hpp.

References dw::framework::Exception::messageStr(), and dw::framework::Exception::status().

◆ getRequired() [1/4]

template<typename T >
void dw::framework::ParameterProvider::getRequired ( dw::core::StringView const &  key,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning false.

See also
getOptional(dw::core::StringView const&, T*)
Exceptions
Exceptionif the parameter is not successfully retrieved

Definition at line 76 of file ParameterProvider.hpp.

References getOptional().

◆ getRequired() [2/4]

template<typename T >
void dw::framework::ParameterProvider::getRequired ( dw::core::StringView const &  key,
size_t const  index,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning false.

See also
getOptional(dw::core::StringView const&, size_t const, T*)
Exceptions
Exceptionif the parameter is not successfully retrieved

Definition at line 91 of file ParameterProvider.hpp.

References getOptional().

◆ getRequired() [3/4]

template<typename S , typename T >
void dw::framework::ParameterProvider::getRequired ( dw::core::StringView const &  key,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning false.

See also
getOptional(dw::core::StringView const&, T*)
Exceptions
Exceptionif the parameter is not successfully retrieved

Definition at line 289 of file ParameterProvider.hpp.

◆ getRequired() [4/4]

template<typename S , typename T >
void dw::framework::ParameterProvider::getRequired ( dw::core::StringView const &  key,
size_t const  index,
T *  out 
) const
inline

Convenience API throwing an exception instead of returning false.

See also
getOptional(dw::core::StringView const&, size_t const, T*)
Exceptions
Exceptionif the parameter is not successfully retrieved

Definition at line 304 of file ParameterProvider.hpp.

◆ operator=() [1/2]

ParameterProvider& dw::framework::ParameterProvider::operator= ( ParameterProvider const &  )
protecteddefault

Copy assignment operator.

◆ operator=() [2/2]

ParameterProvider& dw::framework::ParameterProvider::operator= ( ParameterProvider &&  )
protecteddefault

Move assignment operator.


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