<commit_before># CppDiFactory

A simple C++11 single header dependency injection container

All instances are managed using std::shared_ptr.

The DiFactory allows to register different classes and the interfaces they implement.
There are four different ways the factory can handle classes:

| Name                        | registration method        | Description |
| --------------------------- | -------------------------- | ----------- |
| Regular Class               | registerClass              | Create a new instance each time an instance is required. |
| Singleton Class             | registerInstance           | Always use a predefined instance. |
| Singleton Class on demand   | registerSingleton          | Create an instance the first time it is used and return that instance for each request. Once the instance is not needed anymore (by any user), destroy it again.|
| Single Instance Per Request | registerInstancePerRequest | Similar to regular Class, but when this class is used as a dependency, the same instance will be used for all dependencies of the current request.|

When an instance of an interface is requested, an instance of the class which implements that
interface is returned (this depends on the type of registration of the class).

The DiFactory will validate that all dependencies can be resolved before an object is created. In 
case of an error (missing type, cyclic dependency, ...), an exception is thrown.
To avoid a bigger performance impact, this validation is only done once for each type.
<commit_msg>Update README with Instance Provided at request.<commit_after># CppDiFactory

A simple C++11 single header dependency injection container

All instances are managed using std::shared_ptr.

The DiFactory allows to register different classes and the interfaces they implement.
There are four different ways the factory can handle classes:

| Name                        | registration method        | Description |
| --------------------------- | -------------------------- | ----------- |
| Regular Class               | registerClass              | Create a new instance each time an instance is required. |
| Singleton Class             | registerInstance           | Always use a predefined instance. |
| Singleton Class on demand   | registerSingleton          | Create an instance the first time it is used and return that instance for each request. Once the instance is not needed anymore (by any user), destroy it again.|
| Instance Provided At Request| registerInstanceProvidedAtRequest | CRegister a new class as "Instance Provided At Request". Instances of such classes are never created by the DI-Factory itself. They always need to be provided at runtime when retrieving an instance. |
| Single Instance Per Request | registerInstancePerRequest | Similar to regular Class, but when this class is used as a dependency, the same instance will be used for all dependencies of the current request.|

When an instance of an interface is requested, an instance of the class which implements that
interface is returned (this depends on the type of registration of the class).

The DiFactory will validate that all dependencies can be resolved before an object is created. In 
case of an error (missing type, cyclic dependency, ...), an exception is thrown.
To avoid a bigger performance impact, this validation is only done once for each type.

{'fraction_non_alphanumeric': 0.07694575471698113, 'fraction_numerical': 0.0011792452830188679, 'mean_word_length': 2.9730679156908666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2689283', 'n_tokens_mistral': 697, 'n_tokens_neox': 685, 'n_words': 443}