Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/DevCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

jobs:
test:
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

jobs:
test:
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/MacOs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

jobs:
test:
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ env:

jobs:
test:
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15.0)
set(_7BIT_DI_LIBRARY 7bitDI)

set(_7BIT_DI_VERSION_MAJOR 3)
set(_7BIT_DI_VERSION_MINOR 0)
set(_7BIT_DI_VERSION_MINOR 1)
set(_7BIT_DI_VERSION_PATCH 0)

set(_7BIT_DI_VERSION ${_7BIT_DI_VERSION_MAJOR}.${_7BIT_DI_VERSION_MINOR}.${_7BIT_DI_VERSION_PATCH})
Expand Down
2 changes: 2 additions & 0 deletions Docs/advanced-guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ Advanced Guides
advanced-guides/external-singleton
advanced-guides/keyed-services
advanced-guides/using-aliases
advanced-guides/register-utility-class
advanced-guides/injected-utility-class
advanced-guides/configuring-service-provider
advanced-guides/building-library
22 changes: 22 additions & 0 deletions Docs/advanced-guides/injected-utility-class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Injected Utility Class
========================================

Library provides also Injected_ utility class.
This base class has inject() method that can be used to inject services in simple inline way, also
there are InjectedSingleton, InjectedScoped and InjectedTransient base classes that are inheriting
from Injected and Registered classes to combine these two features. Injected class has also method
getProvider(), raw provider can be used to get keyed services for example.

.. _Injected: ../reference/di/utils/injected.html

.. note::
Class should inherit Injected constructor with 'using Injected::Injected;' in public section

.. literalinclude:: ../../Examples/Guides/InjectedUtilityClass.cpp
:caption: Examples/Guides/InjectedUtilityClass
:language: C++

.. code-block:: console
:caption: Output

actionA, actionB executed.
25 changes: 25 additions & 0 deletions Docs/advanced-guides/register-utility-class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Register Utility Class
========================================

Library provides simple template RegisterService_ utility class.
This base class can be used to automatically register class in service collection with use of specialised TRegisterer.
There are already created aliases RegisterSingleton_, RegisterScoped_, RegisterTransient_ that are registering services
in GlobalServices_ singleton.

.. note::
Class should inherit Injected constructor with 'using Injected::Injected;' in public section

.. _RegisterService: ../reference/di/utils/register.html
.. _RegisterSingleton: ../reference/di/utils/register.html
.. _RegisterScoped: ../reference/di/utils/register.html
.. _RegisterTransient: ../reference/di/utils/register.html
.. _GlobalServices: ../reference/di/utils/globalservices.html

.. literalinclude:: ../../Examples/Guides/RegisterUtilityClass.cpp
:caption: Examples/Guides/RegisterUtilityClass
:language: C++

.. code-block:: console
:caption: Output

actionA_, actionB executed.
2 changes: 1 addition & 1 deletion Docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def createIfNotExists(path):
project = "7bitDI"
copyright = "2023, 7BitCoder Sylwester Dawida"
author = "Sylwester Dawida"
version = "3.0.0"
version = "3.1.0"

extensions = [
"sphinx.ext.autodoc",
Expand Down
6 changes: 1 addition & 5 deletions Docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ Examples
:titlesonly:

examples/simple
examples/logger
examples/cli





6 changes: 6 additions & 0 deletions Docs/examples/logger.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Logger
========================================

.. literalinclude:: ../../Examples/Logger.cpp
:caption: Examples/Logger
:language: C++
4 changes: 2 additions & 2 deletions Docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Installation
FetchContent_Declare(
7bitDI
GIT_REPOSITORY https://github.com/7bitcoder/7bitDI.git
GIT_TAG v3.0.0
GIT_TAG v3.1.0
)
FetchContent_MakeAvailable(7bitDI)

Expand All @@ -48,7 +48,7 @@ Installation
.. code-block:: Txt

[requires]
7bitdi/2.1.0
7bitdi/3.1.0

change the version to newer if available, then run the command:

Expand Down
1 change: 1 addition & 0 deletions Docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Reference
:titlesonly:

reference/di
reference/di/utils
reference/di/details/containers
reference/di/details/core
reference/di/details/factories
Expand Down
5 changes: 1 addition & 4 deletions Docs/reference/di/details/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ sb::di::details - Utils
utils/check.rst
utils/container.rst
utils/ctorparamsnumber.rst
utils/iscopyctor.rst
utils/isinplaceobject.rst
utils/isuniqueptr.rst
utils/removeuniqueptr.rst
utils/meta.rst
utils/require.rst
utils/requiredescriptor.rst
utils/requireinstance.rst
2 changes: 1 addition & 1 deletion Docs/reference/di/details/utils/ctorparamsnumber.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ctorParamsNumber
CtorParamsNumber
========================================

.. doxygenfunction:: sb::di::details::ctorParamsNumber
14 changes: 0 additions & 14 deletions Docs/reference/di/details/utils/iscopyctor.rst

This file was deleted.

10 changes: 0 additions & 10 deletions Docs/reference/di/details/utils/isinplaceobject.rst

This file was deleted.

10 changes: 0 additions & 10 deletions Docs/reference/di/details/utils/isuniqueptr.rst

This file was deleted.

30 changes: 30 additions & 0 deletions Docs/reference/di/details/utils/meta.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Meta
========================================

.. doxygenstruct:: sb::di::details::IsCopyCtor
:members:
:undoc-members:

.. doxygenstruct:: sb::di::details::IsCopyCtor< T, T >
:members:
:undoc-members:

.. doxygenstruct:: sb::di::details::IsCopyCtor< T, const T >
:members:
:undoc-members:

.. doxygenstruct:: sb::di::details::IsUniquePtr
:members:
:undoc-members:

.. doxygenstruct:: sb::di::details::IsUniquePtr< std::unique_ptr< T > >
:members:
:undoc-members:

.. doxygenstruct:: sb::di::details::RemoveUniquePtr
:members:
:undoc-members:

.. doxygenstruct:: sb::di::details::RemoveUniquePtr< std::unique_ptr< T > >
:members:
:undoc-members:
10 changes: 0 additions & 10 deletions Docs/reference/di/details/utils/removeuniqueptr.rst

This file was deleted.

11 changes: 11 additions & 0 deletions Docs/reference/di/utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sb::di - Utils
========================================

.. toctree::
:maxdepth: 5
:titlesonly:

utils/globalservices
utils/injected
utils/register
utils/serviceextractor
6 changes: 6 additions & 0 deletions Docs/reference/di/utils/globalservices.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
GlobalServices
========================================

.. doxygenclass:: sb::di::GlobalServices
:members:
:undoc-members:
22 changes: 22 additions & 0 deletions Docs/reference/di/utils/injected.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Injected
========================================

.. doxygenstruct:: sb::di::Injected
:members:
:protected-members:
:undoc-members:

.. doxygenstruct:: sb::di::InjectedSingleton
:members:
:protected-members:
:undoc-members:

.. doxygenstruct:: sb::di::InjectedScoped
:members:
:protected-members:
:undoc-members:

.. doxygenstruct:: sb::di::InjectedTransient
:members:
:protected-members:
:undoc-members:
30 changes: 30 additions & 0 deletions Docs/reference/di/utils/register.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Register
========================================

.. doxygenstruct:: sb::di::RegisterService
:members:
:undoc-members:

.. doxygenstruct:: sb::di::SingletonRegisterer
:members:
:undoc-members:

.. doxygenstruct:: sb::di::ScopedRegisterer
:members:
:undoc-members:

.. doxygenstruct:: sb::di::TransientRegisterer
:members:
:undoc-members:

.. doxygentypedef:: sb::di::RegisterSingleton
:members:
:undoc-members:

.. doxygentypedef:: sb::di::RegisterScoped
:members:
:undoc-members:

.. doxygentypedef:: sb::di::RegisterTransient
:members:
:undoc-members:
6 changes: 6 additions & 0 deletions Docs/reference/di/utils/serviceextractor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ServiceExtractor
========================================

.. doxygenstruct:: sb::di::ServiceExtractor
:members:
:undoc-members:
Loading