Instances of the Item class are returned from iterators.
More...
#include <EnvironmentProperties.hpp>
|
std::shared_ptr< EnvironmentProperties > | getComposite () const |
| Get the environment properties instance with the specified name. More...
|
|
std::shared_ptr< EnvironmentProperties > | getCompositeOrNull () const |
| Get the environment properties instance with the specified name. More...
|
|
Impl::BindingKey | getKey () const |
| Get the key of the item. More...
|
|
std::string_view | getName () const |
| Get the name of the item. More...
|
|
template<typename BaseT > |
std::unique_ptr< BaseT > | getUnique () const |
| Get the polymorphic value of the specified type and name. More...
|
|
template<typename BaseT > |
std::unique_ptr< BaseT > | getUnique (std::unique_ptr< BaseT > &&defaultValue) const |
| Get the polymorphic value of the specified type and name. More...
|
|
template<typename ValueT > |
ValueT | getValue () const |
| Get the non-polymorphic value of the specified type and name. More...
|
|
template<typename ValueT > |
ValueT | getValue (const ValueT &defaultValue) const |
| Get the non-polymorphic value of the specified type and name. More...
|
|
bool | isComposite () const |
| Returns true if the item is a composite binding with the specified name. More...
|
|
template<typename BaseT > |
bool | isUnique () const |
| Returns true if the item is a unique pointer binding matching the specified type and name. More...
|
|
template<typename ValueT > |
bool | isValue () const |
| Returns true if the item is a value binding matching the specified type and name. More...
|
|
Instances of the Item class are returned from iterators.
◆ getComposite()
Get the environment properties instance with the specified name.
If the item does not proxy to such a binding, NoBindingException is thrown.
- Parameters
-
name | the name of the binding |
- Returns
- the child environment properties instance with the specified name
- Exceptions
-
NoBindingException | if the item does not proxy to such a binding |
◆ getCompositeOrNull()
Get the environment properties instance with the specified name.
If the item does not proxy to such a binding, null is returned.
- Parameters
-
name | the name of the binding |
- Returns
- child environment properties instance with the specified name or null
◆ getKey()
Impl::BindingKey getKey |
( |
| ) |
const |
|
inline |
Get the key of the item.
- Returns
- the key of the item
◆ getName()
std::string_view getName |
( |
| ) |
const |
|
inline |
Get the name of the item.
- Returns
- the name of the item
◆ getUnique() [1/2]
std::unique_ptr<BaseT> getUnique |
( |
| ) |
const |
|
inline |
Get the polymorphic value of the specified type and name.
The value is cloned from the prototype via the base type's provider function in the unique binding.
If the item does not proxy to such a binding, NoBindingException is thrown.
- Template Parameters
-
BaseT | the base type of the unique binding |
- Parameters
-
name | the name of the binding |
- Returns
- a new polymorphic value
- Exceptions
-
NoBindingException | if the item does not proxy to such a binding |
◆ getUnique() [2/2]
std::unique_ptr<BaseT> getUnique |
( |
std::unique_ptr< BaseT > && |
defaultValue | ) |
const |
|
inline |
Get the polymorphic value of the specified type and name.
The value is cloned from the prototype via the type's provider function in the unique binding.
If the item does not proxy to such a binding, the supplied default value is moved into the return value.
- Template Parameters
-
BaseT | the base type of the unique binding |
- Parameters
-
name | the name of the binding |
defaultValue | a default value to copy if the item does not proxy to such a binding |
- Returns
- a new polymorphic value or the supplied default value
◆ getValue() [1/2]
ValueT getValue |
( |
| ) |
const |
|
inline |
Get the non-polymorphic value of the specified type and name.
The value is copy constructed from the prototype in the value binding.
If the item does not proxy to such a binding, NoBindingException is thrown.
- Template Parameters
-
ValueT | the type of the value binding |
- Parameters
-
name | the name of the binding |
- Returns
- a new value
- Exceptions
-
NoBindingException | if the item does not proxy to such a binding |
◆ getValue() [2/2]
ValueT getValue |
( |
const ValueT & |
defaultValue | ) |
const |
|
inline |
Get the non-polymorphic value of the specified type and name.
The value is copy constructed from the prototype in the value binding.
If the item does not proxy to such a binding, the supplied default value is copied into the return value.
- Template Parameters
-
ValueT | the type of the value binding |
- Parameters
-
name | the name of the binding |
defaultValue | a default value to copy if the item does not proxy to such a binding |
- Returns
- a new value or a copy of the supplied default value
◆ isComposite()
bool isComposite |
( |
| ) |
const |
|
inline |
Returns true if the item is a composite binding with the specified name.
- Parameters
-
name | the name of the binding |
- Returns
- true if the item is a composite binding with the specified name
◆ isUnique()
Returns true if the item is a unique pointer binding matching the specified type and name.
- Template Parameters
-
- Parameters
-
name | the name of the binding |
- Returns
- true if the item is a unique pointer binding matching the specified type and name
◆ isValue()
Returns true if the item is a value binding matching the specified type and name.
- Template Parameters
-
ValueT | the value binding type |
- Parameters
-
name | the name of the binding |
- Returns
- true if the item is a value binding matching the specified type and name
The documentation for this class was generated from the following file: