Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::ParametersT< KeyT > Class Template Reference

Configuration parameters. More...

#include <Parameter.hpp>

Inheritance diagram for castor3d::ParametersT< KeyT >:
Inheritance graph
[legend]

Public Member Functions

 ParametersT ()=default
 Constructor.
 
void parse (castor::String const &text)
 Parses the given text into a parameters list.
 
template<typename ValueT >
bool add (KeyT const &name, ValueT *values, uint32_t count)
 adds a parameter
 
void add (ParametersT const &parameters)
 adds a parameters list.
 
template<typename ValueT , uint32_t N>
bool add (KeyT const &name, ValueT const(&values)[N])
 adds a parameter
 
template<typename ValueT >
bool add (KeyT const &name, ValueT const &value)
 adds a parameter
 
bool add (KeyT const &name, castor::String const &value)
 adds a string parameter
 
bool add (KeyT const &name, castor::Path const &value)
 adds a string parameter
 
template<typename ValueT >
bool set (KeyT const &name, ValueT const &value)
 Sets a parameter value.
 
template<typename ValueT >
bool get (KeyT const &name, ValueT *values, uint32_t count) const
 Retrieves a parameter value.
 
template<typename ValueT >
bool get (KeyT const &name, ValueT &value) const
 Retrieves a parameter value.
 
template<typename ValueT , uint32_t N>
bool get (KeyT const &name, ValueT(&values)[N]) const
 Retrieves a parameter value.
 
bool get (KeyT const &name, castor::String &value) const
 Retrieves a parameter value.
 
bool get (KeyT const &name, castor::Path &value) const
 Retrieves a parameter value.
 
template<typename ValueT >
ValueT get (KeyT const &name) const
 Retrieves a parameter value.
 
size_t size () const
 
auto begin () const noexcept
 
auto end () const noexcept
 

Detailed Description

template<typename KeyT>
class castor3d::ParametersT< KeyT >

Configuration parameters.

Remarks
Pair of a name and binary data.

Constructor & Destructor Documentation

◆ ParametersT()

template<typename KeyT >
castor3d::ParametersT< KeyT >::ParametersT ( )
default

Constructor.

Member Function Documentation

◆ add() [1/6]

template<typename KeyT >
bool castor3d::ParametersT< KeyT >::add ( KeyT const & name,
castor::Path const & value )
inline

adds a string parameter

Remarks
If a parameter with the given name already exists, nothing is done
Parameters
[in]nameThe parameter name
[in]valueThe parameter value
Returns
false if a parameter with the given name already exists

References castor3d::ParametersT< KeyT >::add().

Here is the call graph for this function:

◆ add() [2/6]

template<typename KeyT >
bool castor3d::ParametersT< KeyT >::add ( KeyT const & name,
castor::String const & value )
inline

adds a string parameter

Remarks
If a parameter with the given name already exists, nothing is done
Parameters
[in]nameThe parameter name
[in]valueThe parameter value
Returns
false if a parameter with the given name already exists

References castor3d::ParametersT< KeyT >::size().

Here is the call graph for this function:

◆ add() [3/6]

template<typename KeyT >
template<typename ValueT >
bool castor3d::ParametersT< KeyT >::add ( KeyT const & name,
ValueT * values,
uint32_t count )
inline

adds a parameter

Remarks
If a parameter with the given name already exists, nothing is done
Parameters
[in]nameThe parameter name
[in]valuesThe parameter values
[in]countThe values count
Returns
false if a parameter with the given name already exists

Referenced by castor3d::ParametersT< KeyT >::add(), castor3d::ParametersT< KeyT >::add(), castor3d::ParametersT< KeyT >::add(), and castor3d::ParametersT< KeyT >::parse().

Here is the caller graph for this function:

◆ add() [4/6]

template<typename KeyT >
template<typename ValueT >
bool castor3d::ParametersT< KeyT >::add ( KeyT const & name,
ValueT const & value )
inline

adds a parameter

Remarks
If a parameter with the given name already exists, nothing is done
Parameters
[in]nameThe parameter name
[in]valueThe parameter value
Returns
false if a parameter with the given name already exists

References castor3d::ParametersT< KeyT >::add().

Here is the call graph for this function:

◆ add() [5/6]

template<typename KeyT >
template<typename ValueT , uint32_t N>
bool castor3d::ParametersT< KeyT >::add ( KeyT const & name,
ValueT const(&) values[N] )
inline

adds a parameter

Remarks
If a parameter with the given name already exists, nothing is done
Parameters
[in]nameThe parameter name
[in]valuesThe parameter values
Returns
false if a parameter with the given name already exists

References castor3d::ParametersT< KeyT >::add().

Here is the call graph for this function:

◆ add() [6/6]

template<typename KeyT >
void castor3d::ParametersT< KeyT >::add ( ParametersT< KeyT > const & parameters)
inline

adds a parameters list.

Parameters
[in]parametersThe parameters list.

◆ begin()

template<typename KeyT >
auto castor3d::ParametersT< KeyT >::begin ( ) const
inlinenoexcept

Referenced by castor3d::ParametersT< KeyT >::get().

Here is the caller graph for this function:

◆ end()

template<typename KeyT >
auto castor3d::ParametersT< KeyT >::end ( ) const
inlinenoexcept

◆ get() [1/6]

template<typename KeyT >
template<typename ValueT >
ValueT castor3d::ParametersT< KeyT >::get ( KeyT const & name) const
inline

Retrieves a parameter value.

Parameters
[in]nameThe parameter name

References castor3d::ParametersT< KeyT >::get().

Here is the call graph for this function:

◆ get() [2/6]

template<typename KeyT >
bool castor3d::ParametersT< KeyT >::get ( KeyT const & name,
castor::Path & value ) const
inline

Retrieves a parameter value.

Parameters
[in]nameThe parameter name
[out]valueThe parameter value
Returns
false if there is no parameter with the given name

References castor3d::ParametersT< KeyT >::get().

Here is the call graph for this function:

◆ get() [3/6]

template<typename KeyT >
bool castor3d::ParametersT< KeyT >::get ( KeyT const & name,
castor::String & value ) const
inline

Retrieves a parameter value.

Parameters
[in]nameThe parameter name
[out]valueThe parameter value
Returns
false if there is no parameter with the given name

◆ get() [4/6]

template<typename KeyT >
template<typename ValueT >
bool castor3d::ParametersT< KeyT >::get ( KeyT const & name,
ValueT & value ) const
inline

Retrieves a parameter value.

Parameters
[in]nameThe parameter name
[out]valueThe parameter value
Returns
false if there is no parameter with the given name

References castor3d::ParametersT< KeyT >::get().

Here is the call graph for this function:

◆ get() [5/6]

template<typename KeyT >
template<typename ValueT >
bool castor3d::ParametersT< KeyT >::get ( KeyT const & name,
ValueT * values,
uint32_t count ) const
inline

Retrieves a parameter value.

Parameters
[in]nameThe parameter name
[out]valuesThe parameter values
[in]countThe values available count
Returns
false if there is no parameter with the given name

References castor3d::ParametersT< KeyT >::begin().

Referenced by castor3d::ParametersT< KeyT >::get(), castor3d::ParametersT< KeyT >::get(), castor3d::ParametersT< KeyT >::get(), and castor3d::ParametersT< KeyT >::get().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [6/6]

template<typename KeyT >
template<typename ValueT , uint32_t N>
bool castor3d::ParametersT< KeyT >::get ( KeyT const & name,
ValueT(&) values[N] ) const
inline

Retrieves a parameter value.

Parameters
[in]nameThe parameter name
[out]valuesThe parameter values
Returns
false if there is no parameter with the given name

References castor3d::ParametersT< KeyT >::get().

Here is the call graph for this function:

◆ parse()

template<typename KeyT >
void castor3d::ParametersT< KeyT >::parse ( castor::String const & text)
inline

Parses the given text into a parameters list.

Parameters
[in]textThe source text.

References castor3d::ParametersT< KeyT >::add(), cuT, and castor::string::split().

Here is the call graph for this function:

◆ set()

template<typename KeyT >
template<typename ValueT >
bool castor3d::ParametersT< KeyT >::set ( KeyT const & name,
ValueT const & value )
inline

Sets a parameter value.

Parameters
[in]nameThe parameter name
[in]valueThe parameter value
Returns
false if there is no parameter with the given name

◆ size()

template<typename KeyT >
size_t castor3d::ParametersT< KeyT >::size ( ) const
inline

Referenced by castor3d::ParametersT< KeyT >::add().

Here is the caller graph for this function:

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