ADTF
Loading...
Searching...
No Matches
adtf_system.h
Go to the documentation of this file.
1
7#pragma once
9
11#define SESSION_MANAGER_DEFAULT_NAME "session_manager.system.adtf"
13#define LOGGING_DEFAULT_NAME "logging.system.adtf"
15#define RPC_OBJECT_REGISTRY_DEFAULT_NAME "rpc_object_server_registry.system.adtf"
17#define SAMPLE_STREAM_TRACER_DEFAULT_NAME "sample_stream_tracer.system.adtf"
19#define MACRO_RESOLVER_DEFAULT_NAME "macro_resolver.system.adtf"
20
21namespace adtf
22{
23namespace system
24{
25namespace ant
26{
27
31class cADTFSystem final
32{
34 A_UTILS_D(cADTFSystem)
35
36protected:
38 cADTFSystem(const cADTFSystem&) = delete;
45
46public:
51
62 void EnableSessionManagerCreation(bool bEnable = true);
63
73 void EnableLogging(bool bEnable = true);
74
85 void EnableRPCObjectRegistry(bool bEnable = true);
86
96 void EnableMacroResolver(bool bEnable = true);
97
106 void EnableProfiler(bool bEnable = true, unsigned int nPort = 28077, const char* strDumpFile = nullptr);
107
117 void EnableSampleStreamTracer(bool bEnable = true);
118
128 void EnableAutoQuit(bool bEnable = true, base::tADTFRunLevel eLevel = base::tADTFRunLevel::RL_Running);
129
139 void SetSessionManagerCID(const util::cString& strSessionManagerCID);
140
147 void SetADTFDIR(const util::cFilename& strADTFDIR);
148
156 void SetADTFCorePlugin(const util::cFilename& strCorePluginPath);
157
171 void SetLoggingParameter(unsigned int nStdOutLogLevel,
172 unsigned int nStdErrLogLevel,
173 unsigned int nDebugLogLevel,
174 tTimeStamp tmQueueProcessingInterval);
175
192 void SetLoggingParameter(unsigned int nStdOutMinLogLevel,
193 unsigned int nStdOutMaxLogLevel,
194 unsigned int nStdErrMinLogLevel,
195 unsigned int nStdErrMaxLogLevel,
196 unsigned int nDebugMinLogLevel,
197 unsigned int nDebugMaxLogLevel,
198 tTimeStamp tmQueueProcessingInterval);
199
205 void SetAdditionalInitFunction(std::function<tResult()> fnInitFunction);
206
216 void SetRPCURL(const util::cString& strRPCUrl);
217
226
237 tResult Launch(const adtf::util::cCommandLine& oCommandLine);
238
258 tResult Exec(int8_t nFirstRunLevel, const adtf::util::cCommandLine& oCommandLine, std::function<void()> fnStartup);
268 tResult Exec(int8_t nFirstRunLevel,
269 const adtf::util::cCommandLine& oCommandLine,
270 std::function<void()> fnStartup,
271 bool bContinueInCaseOfError);
272
282 const adtf::util::cCommandLine& oCommandLine,
283 std::function<void()> fnStartup,
284 bool bContinueInCaseOfError);
285};
286
287} // namespace ant
288
289using ant::cADTFSystem;
290
291namespace testing
292{
293namespace ant
294{
295
306tResult create_adtf_default_system(const adtf::util::cFilename& strCorePlugin = adtf::util::cFilename(),
307 bool bLogging = false,
308 const adtf::util::cString& strRPCURL = adtf::util::cString(),
309 bool bProfiler = false,
310 unsigned int nProfilingPort = 28077);
311
312template<typename T>
314
315} // namespace ant
316
318using ant::system_executor;
319
320} // namespace testing
321} // namespace system
322
323namespace ucom
324{
325namespace testing
326{
327namespace ant
328{
329
330template<>
331class exec_forward<adtf::system::ant::cADTFSystem>
332{
333private:
334 std::unique_ptr<adtf::system::ant::cADTFSystem> m_pSystem;
335
336public:
337 exec_forward(): m_pSystem(new adtf::system::ant::cADTFSystem())
338 {
339 tResult nLaunchResult = m_pSystem->Launch(adtf::util::cCommandLine());
340 A_UTILS_ASSERT(nLaunchResult.IsOk());
341 }
342
343 ~exec_forward()
344 {
345 if (m_pSystem)
346 {
347 _runtime->SetRunLevel(adtf::base::ant::tADTFRunLevel::RL_Shutdown, true);
348 }
349 }
350
351 tResult Exec(std::function<void()> fnStartup)
352 {
353 return m_pSystem->Exec(adtf::base::ant::tADTFRunLevel::RL_System, adtf::util::cCommandLine(), fnStartup);
354 }
355};
356
357} // namespace ant
358} // namespace testing
359} // namespace ucom
360} // namespace adtf
tResult create_adtf_default_system(const adtf::util::cFilename &strCorePlugin=adtf::util::cFilename(), bool bLogging=false, const adtf::util::cString &strRPCURL=adtf::util::cString(), bool bProfiler=false, unsigned int nProfilingPort=28077)
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
tBool IsOk() const noexcept
Check whether this result object contains ERR_NOERROR.
Definition result.h:431
tADTFMicroRunLevel
Definition adtf_runtime_intf.h:35
Definition adtf_system.h:32
void SetLoggingParameter(unsigned int nStdOutMinLogLevel, unsigned int nStdOutMaxLogLevel, unsigned int nStdErrMinLogLevel, unsigned int nStdErrMaxLogLevel, unsigned int nDebugMinLogLevel, unsigned int nDebugMaxLogLevel, tTimeStamp tmQueueProcessingInterval)
tResult Launch(adtf::ucom::ant::IRuntime &oRuntime)
void SetADTFDIR(const util::cFilename &strADTFDIR)
cADTFSystem(const cADTFSystem &)=delete
pimpl
void EnableProfiler(bool bEnable=true, unsigned int nPort=28077, const char *strDumpFile=nullptr)
void EnableSampleStreamTracer(bool bEnable=true)
tResult ExecMicro(adtf::base::quiet::IADTFRuntime::tADTFMicroRunLevel nFirstMicroRunLevel, const adtf::util::cCommandLine &oCommandLine, std::function< void()> fnStartup, bool bContinueInCaseOfError)
cADTFSystem & operator=(cADTFSystem &&)=delete
move operator
tResult Exec(int8_t nFirstRunLevel, const adtf::util::cCommandLine &oCommandLine, std::function< void()> fnStartup)
void SetSessionManagerCID(const util::cString &strSessionManagerCID)
void SetADTFCorePlugin(const util::cFilename &strCorePluginPath)
cADTFSystem(cADTFSystem &&)=delete
move CTOR
void EnableRPCObjectRegistry(bool bEnable=true)
void SetLoggingParameter(unsigned int nStdOutLogLevel, unsigned int nStdErrLogLevel, unsigned int nDebugLogLevel, tTimeStamp tmQueueProcessingInterval)
cADTFSystem & operator=(const cADTFSystem &)=delete
copy operator
void SetAdditionalInitFunction(std::function< tResult()> fnInitFunction)
void EnableSessionManagerCreation(bool bEnable=true)
void SetRPCURL(const util::cString &strRPCUrl)
void EnableMacroResolver(bool bEnable=true)
tResult Launch(const adtf::util::cCommandLine &oCommandLine)
void EnableAutoQuit(bool bEnable=true, base::tADTFRunLevel eLevel=base::tADTFRunLevel::RL_Running)
void EnableLogging(bool bEnable=true)
Definition runtime_intf.h:104
Definition test_runtime.h:215
tADTFRunLevel
Definition adtf_runtime.h:23
@ RL_Shutdown
The system is shut down.
Definition adtf_runtime.h:25
@ RL_System
The system level.
Definition adtf_runtime.h:27
Namespace for all testing functionality of the ADTF System SDK.
Definition adtf_system.h:292
Namespace for all functionality of the ADTF UCOM SDK provided since v3.0.
Definition adtf_system.h:328
Namespace for all provided testing functionality helper.
Definition adtf_system.h:326
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14