|
lintel 0.2.0
|
#include <Container.h>
Public Member Functions | |
| std::shared_ptr< void > | castTo (const std::type_index &key, const std::shared_ptr< void > &concrete) const |
Public Attributes | |
| std::vector< std::type_index > | keys |
| bool | singleton = false |
| std::function< std::shared_ptr< void >(Container &)> | factory |
| std::unordered_map< std::type_index, std::function< std::shared_ptr< void >(const std::shared_ptr< void > &)> > | casts |
| std::shared_ptr< void > | instance |
| std::mutex | mutex |
A single registration, shared by all keys it is exposed under.
|
inline |
Convert the concrete instance pointer to the subobject addressed by key.
| std::unordered_map<std::type_index, std::function<std::shared_ptr<void>(const std::shared_ptr<void> &)> > lintel::di::Registration::casts |
Per key conversion of the concrete instance to the key's (possibly non-first) base pointer.
Creates the concrete instance; called once per activation (once in total for singletons).
| std::shared_ptr<void> lintel::di::Registration::instance |
Cached singleton instance, empty until the first activation.
| std::vector<std::type_index> lintel::di::Registration::keys |
Every key this registration is reachable through (self plus interfaces).
| std::mutex lintel::di::Registration::mutex |
Serializes the activation of a singleton.
Whether the activated instance is cached and reused.