# component.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/core/macro/component.hpp"

This file contains source code for OATPP_CREATE_COMPONENT and OATPP_COMPONENT macros which are part of oatpp Dependency Injection (DI) framework.

For usage examples see example-projects:


Inject component. Create variable of type=TYPE and name=NAME and assign registered component to it.

  • @param TYPE - type of the component.
  • @param NAME - name of the variable.
  • @param QUALIFIER_NAME - qualifier name is needed if there are multiple components registered of the same type. If there is one component registered only then TYPE info is enought to search for component.



Create component that then can be injected in other application classes.

  • @param TYPE - type of the component.
  • @param NAME - name of the component field.