Public Member Functions | List of all members
EnvironmentProperties::Item Class Reference

Instances of the Item class are returned from iterators. More...

#include <EnvironmentProperties.hpp>

Collaboration diagram for EnvironmentProperties::Item:
[legend]

Public Member Functions

std::shared_ptr< EnvironmentPropertiesgetComposite () const
 Get the environment properties instance with the specified name. More...
 
std::shared_ptr< EnvironmentPropertiesgetCompositeOrNull () 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...
 

Detailed Description

Instances of the Item class are returned from iterators.

Member Function Documentation

◆ getComposite()

std::shared_ptr<EnvironmentProperties> getComposite ( ) const
inline

Get the environment properties instance with the specified name.

If the item does not proxy to such a binding, NoBindingException is thrown.

Parameters
namethe name of the binding
Returns
the child environment properties instance with the specified name
Exceptions
NoBindingExceptionif the item does not proxy to such a binding

◆ getCompositeOrNull()

std::shared_ptr<EnvironmentProperties> getCompositeOrNull ( ) const
inline

Get the environment properties instance with the specified name.

If the item does not proxy to such a binding, null is returned.

Parameters
namethe 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
BaseTthe base type of the unique binding
Parameters
namethe name of the binding
Returns
a new polymorphic value
Exceptions
NoBindingExceptionif 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
BaseTthe base type of the unique binding
Parameters
namethe name of the binding
defaultValuea 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
ValueTthe type of the value binding
Parameters
namethe name of the binding
Returns
a new value
Exceptions
NoBindingExceptionif 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
ValueTthe type of the value binding
Parameters
namethe name of the binding
defaultValuea 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
namethe name of the binding
Returns
true if the item is a composite binding with the specified name

◆ isUnique()

bool isUnique ( ) const
inline

Returns true if the item is a unique pointer binding matching the specified type and name.

Template Parameters
BaseTthe binding's type
Parameters
namethe name of the binding
Returns
true if the item is a unique pointer binding matching the specified type and name

◆ isValue()

bool isValue ( ) const
inline

Returns true if the item is a value binding matching the specified type and name.

Template Parameters
ValueTthe value binding type
Parameters
namethe 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: