5 #include <Poco/Exception.h>
6 #include <Poco/AutoPtr.h>
7 #include <Poco/SharedPtr.h>
8 #include <Poco/SharedLibrary.h>
9 #include <Poco/Logger.h>
10 #include <Poco/Util/AbstractConfiguration.h>
12 #include "di/DIFactory.h"
13 #include "di/DIWrapper.h"
14 #include "util/Loggable.h"
112 typedef std::map<std::string, DIWrapper *> WrapperMap;
113 typedef std::vector<DIWrapper *> WrapperVector;
116 Poco::AutoPtr<Poco::Util::AbstractConfiguration> conf,
117 const std::vector<std::string> &libraryPaths = {},
118 bool avoidEarly =
false);
126 DIWrapper *findImpl(
const std::string &name)
override;
135 const std::string &name,
136 bool detach)
override;
143 const std::type_info &type,
145 void *target)
override;
151 void computeConstants();
159 void cleanup(
const WrapperVector vec)
const;
160 WrapperVector tryDestroy(
const WrapperVector vec)
const;
161 void destroyRest(
const WrapperVector vec)
const;
170 const std::string &name,
175 bool disown =
false);
181 void loadLibrary(Poco::SharedLibrary &library,
const std::string &name)
const;
194 const std::string &key,
195 const std::string &name);
197 void createAndInjectRef(
198 const std::string &targetName,
200 const std::string &name,
201 const std::string &value);
204 const std::string &key,
205 const std::string &name);
207 void evalAndInjectNumber(
208 const std::string &targetName,
210 const std::string &name,
211 const std::string &value);
214 const std::string &key,
215 const std::string &name);
218 const std::string &key,
219 const std::string &name);
222 const std::string &key,
223 const std::string &name);
226 const std::string &key,
227 const std::string &name);
230 const std::string &key,
231 const std::string &name);
235 WrapperVector m_free;
236 Poco::AutoPtr<Poco::Util::AbstractConfiguration> m_conf;
237 std::vector<std::string> m_librariesPaths;
238 std::map<std::string, Poco::SharedLibrary> m_libraries;
Definition: DependencyInjector.h:110
Definition: DependencyInjector.cpp:24
Definition: DIWrapper.h:386
Definition: Loggable.h:19
Implementation of DIFactory can manage and create instances by name and automatically (usually based ...
Definition: DIFactory.h:18