solinject  1.0.0
C++17 Dependency Injection header-only library
sol::di::ConfigurationItem Class Reference

DI configuration item. More...

#include <ConfigurationItem.hpp>

Public Types

using Key = std::string
 Key, used to map classes, registered in a ContainerBuilder to the ones specified in a config file.
 

Public Member Functions

 ConfigurationItem ()
 Parameterless constructor.
 
 ConfigurationItem (std::string interfaceKey, std::string implementationKey, ServiceLifetime lifetime)
 Constructor. More...
 
 ConfigurationItem (std::string key, ServiceLifetime lifetime)
 Constructor. Used when the interface key and the implementation key are identical. More...
 
 ConfigurationItem (const ConfigurationItem &other)
 Copy constructor.
 
 ConfigurationItem (ConfigurationItem &&other) noexcept
 Move constructor.
 
ConfigurationItemoperator= (ConfigurationItem other) noexcept
 Copy-assignment operator.
 
Key InterfaceKey () const
 Interface key property. More...
 
Key ImplementationKey () const
 Implementation key property. More...
 
ServiceLifetime Lifetime () const
 Lifetime property. More...
 

Friends

void swap (ConfigurationItem &a, ConfigurationItem &b)
 Swaps to ConfigurationItem instances.
 

Detailed Description

DI configuration item.

Constructor & Destructor Documentation

◆ ConfigurationItem() [1/2]

sol::di::ConfigurationItem::ConfigurationItem ( std::string  interfaceKey,
std::string  implementationKey,
ServiceLifetime  lifetime 
)
inline

Constructor.

Parameters
interfaceKeythe interface key
implementationKeythe implementation key
lifetimethe service lifetime

◆ ConfigurationItem() [2/2]

sol::di::ConfigurationItem::ConfigurationItem ( std::string  key,
ServiceLifetime  lifetime 
)
inline

Constructor. Used when the interface key and the implementation key are identical.

Parameters
keythe service key
lifetimethe service lifetime

Member Function Documentation

◆ ImplementationKey()

Key sol::di::ConfigurationItem::ImplementationKey ( ) const
inline

Implementation key property.

Returns
the implementation key

◆ InterfaceKey()

Key sol::di::ConfigurationItem::InterfaceKey ( ) const
inline

Interface key property.

Returns
the interface key

◆ Lifetime()

ServiceLifetime sol::di::ConfigurationItem::Lifetime ( ) const
inline

Lifetime property.

Returns
the service lifetime

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