BindingBuilder.hpp
Go to the documentation of this file.
1 // @formatter:off
2 //
3 // Balau core C++ library
4 //
5 // Copyright (C) 2008 Bora Software (contact@borasoftware.com)
6 //
7 // Licensed under the Boost Software License - Version 1.0 - August 17th, 2003.
8 // See the LICENSE file for the full license text.
9 //
10 
16 
17 #ifndef COM_BORA_SOFTWARE__BALAU_APPLICATION__BINDING_BUILDER
18 #define COM_BORA_SOFTWARE__BALAU_APPLICATION__BINDING_BUILDER
19 
20 #include <Balau/Application/Impl/Binding.hpp>
21 #include <Balau/Application/Impl/InjectorLogger.hpp>
22 
23 namespace Balau {
24 
25 namespace Impl {
26 
27 template <typename ValueT> class ValuePropertyBindingBuilderFactory;
28 template <typename ValueT> class UniquePropertyBindingBuilderFactory;
29 
30 } // namespace Impl
31 
35 template <typename BaseT>
36 using UniquePropertyCloner = std::function<std::unique_ptr<BaseT> (const std::unique_ptr<const BaseT> &)>;
37 
43 template <typename BaseT, typename DeleterT>
44 class BindingBuilder final : public Impl::BindingBuilderBase {
45  private: using UniquePtrProviderFunction = std::function<std::unique_ptr<BaseT> ()>;
46 
52  public: void toValue() {
53  warnInvalidConstQualifier(Impl::BindingMetaType::Value);
54  using U = typename std::remove_const<BaseT>::type;
55  using T = Impl::BindingKeyType<Impl::BindingMetaType::Value, U>;
56  setKeyType<T>();
57  supplier = std::unique_ptr<BindingSupplier>(new InstantiatingValueBindingSupplier());
58  }
59 
66  public: template <typename ValueT = BaseT> void toValue(ValueT prototype) {
67  warnInvalidConstQualifier(Impl::BindingMetaType::Value);
68  using U = typename std::remove_const<BaseT>::type;
69  using T = Impl::BindingKeyType<Impl::BindingMetaType::Value, U>;
70  setKeyType<T>();
71  supplier = std::unique_ptr<BindingSupplier>(new PrototypeBindingSupplier(prototype));
72  }
73 
79  public: template <typename ProviderFunctionT> void toValueProvider(ProviderFunctionT provider) {
80  warnInvalidConstQualifier(Impl::BindingMetaType::Value);
81  using U = typename std::remove_const<BaseT>::type;
82  using T = Impl::BindingKeyType<Impl::BindingMetaType::Value, U>;
83  setKeyType<T>();
84  supplier = std::unique_ptr<BindingSupplier>(new ProvidingFunctionValueBindingSupplier<ProviderFunctionT>(provider));
85  }
86 
92  public: template <typename ProviderT> void toValueProvider() {
93  warnInvalidConstQualifier(Impl::BindingMetaType::Value);
94  using U = typename std::remove_const<BaseT>::type;
95  using T = Impl::BindingKeyType<Impl::BindingMetaType::Value, U>;
96  setKeyType<T>();
97  supplier = std::unique_ptr<BindingSupplier>(new ProvidingClassValueBindingSupplier<ProviderT>());
98  }
99 
107  public: template <typename ProviderT> void toValueProvider(std::shared_ptr<ProviderT> provider) {
108  warnInvalidConstQualifier(Impl::BindingMetaType::Value);
109  using U = typename std::remove_const<BaseT>::type;
110  using T = Impl::BindingKeyType<Impl::BindingMetaType::Value, U>;
111  setKeyType<T>();
112  supplier = std::unique_ptr<BindingSupplier>(new ProvidingClassInstanceValueBindingSupplier<ProviderT>(std::move(provider)));
113  }
114 
120  public: template <typename DerivedT> void toUnique() {
121  warnInvalidConstQualifier(Impl::BindingMetaType::Unique);
122  using U = typename std::remove_const<BaseT>::type;
123  using T = Impl::BindingKeyType<Impl::BindingMetaType::Unique, U, DeleterT>;
124  setKeyType<T>();
125  supplier = std::unique_ptr<BindingSupplier>(new InstantiatingUniquePtrBindingSupplier<DerivedT>());
126  }
127 
133  public: void toUniqueProvider(UniquePtrProviderFunction provider) {
134  warnInvalidConstQualifier(Impl::BindingMetaType::Unique);
135  using U = typename std::remove_const<BaseT>::type;
136  using T = Impl::BindingKeyType<Impl::BindingMetaType::Unique, U, DeleterT>;
137  setKeyType<T>();
138  supplier = std::unique_ptr<BindingSupplier>(new ProvidingFunctionUniquePtrBindingSupplier(provider));
139  }
140 
146  public: template <typename ProviderT> void toUniqueProvider() {
147  warnInvalidConstQualifier(Impl::BindingMetaType::Unique);
148  using U = typename std::remove_const<BaseT>::type;
149  using T = Impl::BindingKeyType<Impl::BindingMetaType::Unique, U, DeleterT>;
150  setKeyType<T>();
151  supplier = std::unique_ptr<BindingSupplier>(new ProvidingClassUniquePtrBindingSupplier<ProviderT>());
152  }
153 
161  public: template <typename ProviderT> void toUniqueProvider(std::shared_ptr<ProviderT> provider) {
162  warnInvalidConstQualifier(Impl::BindingMetaType::Unique);
163  using U = typename std::remove_const<BaseT>::type;
164  using T = Impl::BindingKeyType<Impl::BindingMetaType::Unique, U, DeleterT>;
165  setKeyType<T>();
166  supplier = std::unique_ptr<BindingSupplier>(new ProvidingClassInstanceUniquePtrBindingSupplier<ProviderT>(std::move(provider)));
167  }
168 
174  public: void toReference(BaseT & reference) {
175  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Reference, BaseT>>();
176  supplier = std::unique_ptr<BindingSupplier>(new ReferenceBindingSupplier(reference));
177  }
178 
184  public: template <typename DerivedT> void toThreadLocal() {
185  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
186  supplier = std::unique_ptr<BindingSupplier>(new ThreadLocalSingletonBindingSupplier<DerivedT>());
187  }
188 
194  public: template <typename DerivedT, typename SharedDeleterT> void toThreadLocal() {
195  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
196  supplier = std::unique_ptr<BindingSupplier>(new ThreadLocalSingletonBindingSupplier<DerivedT, SharedDeleterT>());
197  }
198 
204  public: void toThreadLocal() {
205  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
206  supplier = std::unique_ptr<BindingSupplier>(new ThreadLocalSingletonBindingSupplier<BaseT>());
207  }
208 
214  public: template <typename DerivedT> void toSingleton() {
215  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
216  supplier = std::unique_ptr<BindingSupplier>(new LazySingletonBindingSupplier<DerivedT>());
217  }
218 
224  public: template <typename DerivedT, typename SharedDeleterT> void toSingleton() {
225  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
226  supplier = std::unique_ptr<BindingSupplier>(new LazySingletonBindingSupplier<DerivedT, SharedDeleterT>());
227  }
228 
234  public: void toSingleton() {
235  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
236  supplier = std::unique_ptr<BindingSupplier>(new LazySingletonBindingSupplier<BaseT>());
237  }
238 
247  public: void toSingleton(std::shared_ptr<BaseT> instance) {
248  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
249  supplier = std::unique_ptr<BindingSupplier>(new ProvidedSingletonBindingSupplier(instance));
250  }
251 
261  public: void toSingleton(BaseT * instance) {
262  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
263  toSingleton(std::shared_ptr<BaseT>(instance));
264  }
265 
275  public: template <typename SharedDeleterT> void toSingleton(BaseT * instance) {
276  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
277  toSingleton(std::shared_ptr<BaseT>(instance, SharedDeleterT()));
278  }
279 
285  public: template <typename ProviderT> void toSingletonProvider() {
286  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
287  supplier = std::unique_ptr<BindingSupplier>(new ProvidingClassSingletonBindingSupplier<ProviderT>());
288  }
289 
297  public: template <typename ProviderT> void toSingletonProvider(std::shared_ptr<ProviderT> provider) {
298  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
299  supplier = std::unique_ptr<BindingSupplier>(new ProvidingClassInstanceSingletonBindingSupplier<ProviderT>(std::move(provider)));
300  }
301 
307  public: void toSingletonProvider(const std::function<std::shared_ptr<BaseT> ()> & provider) {
308  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
309  supplier = std::unique_ptr<BindingSupplier>(new ProvidingFunctionSingletonBindingSupplier(provider));
310  }
311 
317  public: template <typename DerivedT> void toEagerSingleton() {
318  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
319  supplier = std::unique_ptr<BindingSupplier>(new EagerSingletonBindingSupplier<DerivedT>());
320  }
321 
327  public: template <typename DerivedT, typename SharedDeleterT> void toEagerSingleton() {
328  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
329  supplier = std::unique_ptr<BindingSupplier>(new EagerSingletonBindingSupplier<DerivedT, SharedDeleterT>());
330  }
331 
337  public: void toEagerSingleton() {
338  setKeyType<Impl::BindingKeyType<Impl::BindingMetaType::Shared, BaseT>>();
339  supplier = std::unique_ptr<BindingSupplier>(new EagerSingletonBindingSupplier<BaseT>());
340  }
341 
343 
344  public: BindingBuilder(const BindingBuilder & rhs) = delete;
345  public: BindingBuilder & operator = (const BindingBuilder & rhs) = delete;
346 
347  // Binding suppliers use candidate information to create bindings.
348  private: class BindingSupplier {
349  public: virtual ~BindingSupplier() = default;
350 
351  public: virtual std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const = 0;
352  };
353 
354  private: class InstantiatingValueBindingSupplier : public BindingSupplier {
355  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
356  return std::unique_ptr<Impl::AbstractBinding>(new Impl::InstantiatingValueBinding<BaseT>(std::move(key)));
357  }
358  };
359 
360  private: class PrototypeBindingSupplier : public BindingSupplier {
361  private: const BaseT prototype;
362 
363  public: explicit PrototypeBindingSupplier(const BaseT & prototype_)
364  : prototype(prototype_) {}
365 
366  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
367  return std::unique_ptr<Impl::AbstractBinding>(new Impl::PrototypeBinding<BaseT>(std::move(key), prototype));
368  }
369  };
370 
371  private: template <typename ProviderFunctionT>
372  class ProvidingFunctionValueBindingSupplier : public BindingSupplier {
373  private: const ProviderFunctionT provide;
374 
375  public: explicit ProvidingFunctionValueBindingSupplier(ProviderFunctionT provide_)
376  : provide(provide_) {}
377 
378  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
379  return std::unique_ptr<Impl::AbstractBinding>(
380  new Impl::ProvidingFunctionValueBinding<BaseT, ProviderFunctionT>(std::move(key), provide)
381  );
382  }
383  };
384 
385  private: template <typename ProviderT> class ProvidingClassValueBindingSupplier : public BindingSupplier {
386  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
387  return std::unique_ptr<Impl::AbstractBinding>(
388  new Impl::ProvidingClassValueBinding<BaseT, ProviderT>(std::move(key))
389  );
390  }
391  };
392 
393  private: template <typename ProviderT> class ProvidingClassInstanceValueBindingSupplier : public BindingSupplier {
394  public: explicit ProvidingClassInstanceValueBindingSupplier(std::shared_ptr<ProviderT> && provider_) noexcept
395  : provider(std::move(provider_)) {}
396 
397  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
398  return std::unique_ptr<Impl::AbstractBinding>(
399  new Impl::ProvidingClassInstanceValueBinding<BaseT, ProviderT>(std::move(key), provider)
400  );
401  }
402 
403  std::shared_ptr<ProviderT> provider;
404  };
405 
406  private: class ReferenceBindingSupplier : public BindingSupplier {
407  private: BaseT & reference;
408 
409  public: explicit ReferenceBindingSupplier(BaseT & reference_)
410  : reference(reference_) {}
411 
412  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
413  return std::unique_ptr<Impl::AbstractBinding>(
414  new Impl::StandardReferenceBinding<BaseT>(std::move(key), reference)
415  );
416  }
417  };
418 
419  private: template <typename DerivedT> class InstantiatingUniquePtrBindingSupplier : public BindingSupplier {
420  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
421  return std::unique_ptr<Impl::AbstractBinding>(
422  new Impl::InstantiatingUniquePtrBinding<BaseT, DerivedT, DeleterT>(std::move(key))
423  );
424  }
425  };
426 
427  private: class ProvidingFunctionUniquePtrBindingSupplier : public BindingSupplier {
428  private: const UniquePtrProviderFunction provide;
429 
430  public: explicit ProvidingFunctionUniquePtrBindingSupplier(UniquePtrProviderFunction provide_)
431  : provide(provide_) {}
432 
433  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
434  return std::unique_ptr<Impl::AbstractBinding>(
435  new Impl::ProvidingFunctionUniquePtrBinding<BaseT, DeleterT>(std::move(key), provide)
436  );
437  }
438  };
439 
440  private: template <typename ProviderT> class ProvidingClassUniquePtrBindingSupplier : public BindingSupplier {
441  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
442  return std::unique_ptr<Impl::AbstractBinding>(
443  new Impl::ProvidingClassUniquePtrBinding<BaseT, ProviderT, DeleterT>(std::move(key))
444  );
445  }
446  };
447 
448  private: template <typename ProviderT> class ProvidingClassInstanceUniquePtrBindingSupplier : public BindingSupplier {
449  public: explicit ProvidingClassInstanceUniquePtrBindingSupplier(std::shared_ptr<ProviderT> && provider_) noexcept
450  : provider(std::move(provider_)) {}
451 
452  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
453  return std::unique_ptr<Impl::AbstractBinding>(
454  new Impl::ProvidingClassInstanceUniquePtrBinding<BaseT, ProviderT, DeleterT>(std::move(key), provider)
455  );
456  }
457 
458  private: std::shared_ptr<ProviderT> provider;
459  };
460 
461  private: template <typename DerivedT, typename ThreadLocalDeleterT = std::default_delete<BaseT>> class ThreadLocalSingletonBindingSupplier : public BindingSupplier {
462  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
463  return std::unique_ptr<Impl::AbstractBinding>(
464  new Impl::ThreadLocalSingletonBinding<BaseT, DerivedT, ThreadLocalDeleterT>(std::move(key))
465  );
466  }
467  };
468 
469  private: class ProvidedSingletonBindingSupplier : public BindingSupplier {
470  private: const std::shared_ptr<BaseT> instance;
471 
472  public: explicit ProvidedSingletonBindingSupplier(std::shared_ptr<BaseT> instance_)
473  : instance(std::move(instance_)) {}
474 
475  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
476  return std::unique_ptr<Impl::AbstractBinding>(
477  new Impl::ProvidedSingletonBinding<BaseT>(std::move(key), instance)
478  );
479  }
480  };
481 
482  private: template <typename ProviderT> class ProvidingClassSingletonBindingSupplier : public BindingSupplier {
483  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
484  return std::unique_ptr<Impl::AbstractBinding>(
485  new Impl::ProvidingClassSingletonBinding<BaseT, ProviderT>(std::move(key))
486  );
487  }
488  };
489 
490  private: template <typename ProviderT> class ProvidingClassInstanceSingletonBindingSupplier : public BindingSupplier {
491  public: explicit ProvidingClassInstanceSingletonBindingSupplier(std::shared_ptr<ProviderT> && provider_) noexcept
492  : provider(std::move(provider_)) {}
493 
494  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
495  return std::unique_ptr<Impl::AbstractBinding>(
496  new Impl::ProvidingClassInstanceSingletonBinding<BaseT, ProviderT>(std::move(key), provider)
497  );
498  }
499 
500  private: std::shared_ptr<ProviderT> provider;
501  };
502 
503  private: class ProvidingFunctionSingletonBindingSupplier : public BindingSupplier {
504  public: explicit ProvidingFunctionSingletonBindingSupplier(const std::function<std::shared_ptr<BaseT> ()> & provider_) noexcept
505  : provider(provider_) {}
506 
507  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
508  return std::unique_ptr<Impl::AbstractBinding>(
509  new Impl::ProvidingFunctionSingletonBinding<BaseT>(std::move(key), provider)
510  );
511  }
512 
513  private: const std::function<std::shared_ptr<BaseT> ()> provider;
514  };
515 
516  private: template <typename DerivedT, typename SharedDeleterT = std::default_delete<BaseT>> class LazySingletonBindingSupplier : public BindingSupplier {
517  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
518  return std::unique_ptr<Impl::AbstractBinding>(
519  new Impl::LazySingletonBinding<BaseT, DerivedT, SharedDeleterT>(std::move(key))
520  );
521  }
522  };
523 
524  private: template <typename DerivedT, typename SharedDeleterT = std::default_delete<BaseT>> class EagerSingletonBindingSupplier : public BindingSupplier {
525  public: std::unique_ptr<Impl::AbstractBinding> build(Impl::BindingKey && key) const override {
526  return std::unique_ptr<Impl::AbstractBinding>(
527  new Impl::EagerSingletonBinding<BaseT, DerivedT, SharedDeleterT>(std::move(key))
528  );
529  }
530  };
531 
532  private: void warnInvalidConstQualifier(Impl::BindingMetaType metaType) {
533  if (!std::is_same<BaseT, typename std::remove_const<BaseT>::type>::value) {
534  Impl::InjectorLogger::log().warn(
535  "{} binding key {} has been defined with a const type. This "
536  "qualifier will be removed from the key because {} types cannot "
537  "be const qualified. This will not affect binding semantics."
538  , metaType
539  , key
540  , metaType
541  );
542  }
543  }
544 
545  friend class ApplicationConfiguration;
546  friend class EnvironmentConfiguration;
547  template <typename ValueT> friend class Impl::ValuePropertyBindingBuilderFactory;
548  template <typename ValueT> friend class Impl::UniquePropertyBindingBuilderFactory;
549 
550  private: explicit BindingBuilder(std::string && name)
551  : Impl::BindingBuilderBase(std::move(name)) {}
552 
553  private: std::unique_ptr<Impl::AbstractBinding> build() override {
554  return supplier->build(std::move(key));
555  }
556 
557  private: std::unique_ptr<BindingSupplier> supplier;
558 };
559 
560 } // namespace Balau
561 
562 #endif // COM_BORA_SOFTWARE__BALAU_APPLICATION__BINDING_BUILDER
void toEagerSingleton()
Bind an interface to a concrete singleton type.
Definition: BindingBuilder.hpp:317
Application configurations specify application injector bindings.
Definition: ApplicationConfiguration.hpp:34
void toValue(ValueT prototype)
Bind a concrete type to a prototype value.
Definition: BindingBuilder.hpp:66
void toThreadLocal()
Bind an interface to a concrete type with thread-local singleton semantics.
Definition: BindingBuilder.hpp:184
void toUniqueProvider()
Bind an interface to a unique pointer provider class.
Definition: BindingBuilder.hpp:146
An injector binding candidate created via the injector configuration.
Definition: BindingBuilder.hpp:44
void toUniqueProvider(std::shared_ptr< ProviderT > provider)
Bind an interface to a unique pointer provider class instance.
Definition: BindingBuilder.hpp:161
void toSingleton(BaseT *instance)
Bind an interface to a specific instance, via a pointer container type syntax.
Definition: BindingBuilder.hpp:261
void toSingleton(std::shared_ptr< BaseT > instance)
Bind an interface to a specific instance.
Definition: BindingBuilder.hpp:247
The root Balau namespace.
Definition: ApplicationConfiguration.hpp:23
void toEagerSingleton()
Bind a concrete singleton type.
Definition: BindingBuilder.hpp:337
void toSingleton()
Bind an interface to a concrete singleton type, using the supplied deleter type.
Definition: BindingBuilder.hpp:224
Environment configurations specify typed and untyped environment injector bindings.
Definition: EnvironmentConfiguration.hpp:97
void toReference(BaseT &reference)
Bind a reference type to a reference value.
Definition: BindingBuilder.hpp:174
void toUniqueProvider(UniquePtrProviderFunction provider)
Bind an interface to a unique pointer provider function.
Definition: BindingBuilder.hpp:133
void toEagerSingleton()
Bind an interface to a concrete singleton type, using the supplied deleter type.
Definition: BindingBuilder.hpp:327
void toSingletonProvider()
Bind an interface to a singleton provider class.
Definition: BindingBuilder.hpp:285
void toSingleton()
Bind an interface to a concrete singleton type.
Definition: BindingBuilder.hpp:214
void toValueProvider()
Bind a concrete type to a value provider class.
Definition: BindingBuilder.hpp:92
void toValueProvider(ProviderFunctionT provider)
Bind a concrete type to a value provider function.
Definition: BindingBuilder.hpp:79
void toSingleton()
Bind a concrete singleton type.
Definition: BindingBuilder.hpp:234
void toSingleton(BaseT *instance)
Bind an interface to a specific instance, via a pointer container type syntax and using the supplied ...
Definition: BindingBuilder.hpp:275
void toValueProvider(std::shared_ptr< ProviderT > provider)
Bind a concrete type to a value provider class instance.
Definition: BindingBuilder.hpp:107
void toUnique()
Bind an interface to an implementing class.
Definition: BindingBuilder.hpp:120
void toSingletonProvider(const std::function< std::shared_ptr< BaseT >()> &provider)
Bind an interface to a singleton provider function.
Definition: BindingBuilder.hpp:307
void toValue()
Bind a concrete type.
Definition: BindingBuilder.hpp:52
void toThreadLocal()
Bind a concrete type with thread-local singleton semantics.
Definition: BindingBuilder.hpp:204
std::function< std::unique_ptr< BaseT >(const std::unique_ptr< const BaseT > &)> UniquePropertyCloner
The clone function type for unique pointer prototypes.
Definition: BindingBuilder.hpp:36
void toSingletonProvider(std::shared_ptr< ProviderT > provider)
Bind an interface to a singleton provider class instance.
Definition: BindingBuilder.hpp:297
void toThreadLocal()
Bind an interface to a concrete type with thread-local singleton semantics, using the supplied delete...
Definition: BindingBuilder.hpp:194