Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ybainier/Hypodermic
Hypodermic is an IoC container for C++. It provides dependency injection to your existing design.
https://github.com/ybainier/Hypodermic
Last synced: 18 days ago
JSON representation
Hypodermic is an IoC container for C++. It provides dependency injection to your existing design.
- Host: GitHub
- URL: https://github.com/ybainier/Hypodermic
- Owner: ybainier
- License: mit
- Created: 2014-10-26T10:19:18.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-06-11T15:12:39.000Z (over 1 year ago)
- Last Synced: 2024-10-01T22:38:27.940Z (about 1 month ago)
- Language: C++
- Size: 679 KB
- Stars: 574
- Watchers: 34
- Forks: 81
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Hypodermic
==========[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
[![Build status](https://img.shields.io/appveyor/ci/ybainier/Hypodermic/master.svg?label=windows)](https://ci.appveyor.com/project/ybainier/hypodermic)
[![Build Status](https://img.shields.io/travis/ybainier/Hypodermic/master.svg?label=linux/osx)](https://travis-ci.org/ybainier/Hypodermic)Hypodermic is a non-intrusive header only [IoC container](http://martinfowler.com/articles/injection.html) for C++. It provides dependency injection to your existing design by _managing the creation of your components and their dependencies_ in the right order, sparing you the trouble of writing and maintaining boiler plate code.
Used in production environments since 2012.
## First steps
Configure the container by registering your components
```cpp
ContainerBuilder builder;builder.registerType< MessageDispatcher >();
auto container = builder.build();
```... then ask the container to give you an instance of that type
```cpp
auto dispatcher = container->resolve< MessageDispatcher >();
```Want to discover what happened here? Learn to use more features through the [beginner's guide](https://github.com/ybainier/Hypodermic/wiki/Getting-started) on the wiki.
## Benchmarks
Some comparative benchmarks are available on the wiki, [check them out](https://github.com/ybainier/Hypodermic/wiki/Benchmarks).
## Acknowledgment
Hypodermic was started with the will to mimic the famous .NET Autofac http://autofac.org/. Although its design evolved, both its behavior and its expressiveness tend to remain the same.
Constructor deduction has been made possible thanks to the work of [Krzysztof Jusiak](http://krzysztof.jusiak.net/) in http://boost-experimental.github.io/di/.