-
Notifications
You must be signed in to change notification settings - Fork 40
Home
Welcome to our documentation!
Kangaru is a simple inversion of control container for C++11 and later. Our goal is to create a container capable of automatic dependency injection that do most diagnostics at compile time, while keeping the simplest interface possible, and all that without modifying existing classes. Kangaru is a header only library because of it's extensive use of templates. The name kangaru comes from the container's feature that consists in injecting itself into a service as a dependency.
Indeed, the container does not impose a way to construct, allocate memory, contain or inject your classes. You are in full control of everything related to the classes of your project.
Getting started with kangaru is easy. First of all, you need to include the library:
#include <kangaru/kangaru.hpp>
Take note that you will need to add the library to your include paths.
All declarations are made in the namespace kgr
. Additionnaly, the namespace kgr
contains the namespace detail
, which itself contains implementation details.
Note that the detail
namespace is not considered as a part of the API and its content might be subject to changes.
In this documentation, many classes will be refered as services or service definitions.
Services are classes that are either injected by the container or have other classes as dependencies.
Service Definitions are classes that contain a service and tell the container how this particular service should behave within the container.
This library does not make use of macros of macros to prevent multiple inclusion.
Every macros that starts with KGR_KANGARU_
is considered reserved.
Note that some features of this library are easier to use with macros, and we recommend you to use those that are defined in the documentation.
Macros defined by the library are not part of it's interface.