ADTF  3.18.2
cADTFSystemfinal

ADTF System Creation Class. More...

Public Member Functions

 cADTFSystem ()
 CTOR.
 
 ~cADTFSystem ()
 DTOR.
 
void EnableSessionManagerCreation (bool bEnable=true)
 Enables the session manager core object creation. More...
 
void EnableLogging (bool bEnable=true)
 Enables the logging core object creation. More...
 
void EnableRPCObjectRegistry (bool bEnable=true)
 Enables the rpc object registry core object creation. More...
 
void EnableMacroResolver (bool bEnable=true)
 Enables macro resolver core object creation. More...
 
void EnableProfiler (bool bEnable=true, unsigned int nPort=28077, const char *strDumpFile=nullptr)
 Enables the profiler. More...
 
void EnableSampleStreamTracer (bool bEnable=true)
 Enables the sample stream tracer core object creation. More...
 
void EnableAutoQuit (bool bEnable=true, base::tADTFRunLevel eLevel=base::tADTFRunLevel::RL_Running)
 Enables to shutdown automatically if the given runlevel is left by decrementing. More...
 
void SetSessionManagerCID (const util::cString &strSessionManagerCID)
 Sets the class id used for creation of the session manager core object (EnableSessionManagerCreation). More...
 
void SetADTFDIR (const util::cFilename &strADTFDIR)
 Sets the environment variable ADTF_DIR. More...
 
void SetADTFCorePlugin (const util::cFilename &strCorePluginPath)
 Sets the path to the adtf_core.plugin which contains the the core objects implementations. More...
 
void SetLoggingParameter (unsigned int nStdOutLogLevel, unsigned int nStdErrLogLevel, unsigned int nDebugLogLevel, tTimeStamp tmQueueProcessingInterval)
 Sets the logging parameter of the Logging serive These core objects define the ADTF System. More...
 
void SetLoggingParameter (unsigned int nStdOutMinLogLevel, unsigned int nStdOutMaxLogLevel, unsigned int nStdErrMinLogLevel, unsigned int nStdErrMaxLogLevel, unsigned int nDebugMinLogLevel, unsigned int nDebugMaxLogLevel, tTimeStamp tmQueueProcessingInterval)
 Sets the log levels that are output via a specific channel. More...
 
void SetAdditionalInitFunction (std::function< tResult()> fnInitFunction)
 Adds an additional Initialization function that is called right atfer the logging has been set up. More...
 
void SetRPCURL (const util::cString &strRPCUrl)
 Sets the URL for the rpc object registry core object. More...
 
tResult Launch (adtf::ucom::ant::IRuntime &oRuntime)
 Launches the system and its core objects to an existing runtime. More...
 
tResult Launch (const adtf::util::cCommandLine &oCommandLine)
 Launches the system and create a adtf::base::ant::cADTFRuntime. More...
 
tResult Exec (int8_t nFirstRunLevel, const adtf::util::cCommandLine &oCommandLine, std::function< void()> fnStartup)
 Launches the system and create a adtf::base::ant::cADTFRuntime. More...
 
tResult Exec (int8_t nFirstRunLevel, const adtf::util::cCommandLine &oCommandLine, std::function< void()> fnStartup, bool bContinueInCaseOfError)
 
tResult ExecMicro (adtf::base::quiet::IADTFRuntime::tADTFMicroRunLevel nFirstMicroRunLevel, const adtf::util::cCommandLine &oCommandLine, std::function< void()> fnStartup, bool bContinueInCaseOfError)
 

Protected Member Functions

 cADTFSystem (const cADTFSystem &)=delete
 copy CTOR
 
cADTFSystemoperator= (const cADTFSystem &)=delete
 copy operator
 
 cADTFSystem (cADTFSystem &&)=delete
 move CTOR
 
cADTFSystemoperator= (cADTFSystem &&)=delete
 move operator
 

Private Member Functions

 A_UTILS_D (cADTFSystem)
 pimpl
 

Detailed Description

ADTF System Creation Class.

Definition at line 31 of file adtf_system.h.

Member Function Documentation

◆ EnableAutoQuit()

void EnableAutoQuit ( bool  bEnable = true,
base::tADTFRunLevel  eLevel = base::tADTFRunLevel::RL_Running 
)

Enables to shutdown automatically if the given runlevel is left by decrementing.

Per default the AutoQuit is disabled.

Parameters
[in]bEnableenable or disable.
[in]eLevellevel of auto quit.

◆ EnableLogging()

void EnableLogging ( bool  bEnable = true)

Enables the logging core object creation.

Per default the creation is disabled.

Parameters
[in]bEnableenable or disable.
See also
adtf::services::ant::ILogging, SetLoggingParameter.

◆ EnableMacroResolver()

void EnableMacroResolver ( bool  bEnable = true)

Enables macro resolver core object creation.

Per default the creation is disabled.

Parameters
[in]bEnableenable or disable.
See also
adtf::services::ant::IMacroResolver.

◆ EnableProfiler()

void EnableProfiler ( bool  bEnable = true,
unsigned int  nPort = 28077,
const char *  strDumpFile = nullptr 
)

Enables the profiler.

Parameters
[in]bEnableenable or disable.
[in]nPortThe listening port that the GUI can connect on, 0 = disable remote profiling.
[in]strDumpFileIf set, profiling will be enabled right from the start and profiling data will be dumped to the given file during shutdown.

◆ EnableRPCObjectRegistry()

void EnableRPCObjectRegistry ( bool  bEnable = true)

Enables the rpc object registry core object creation.

Per default the creation is disabled. Per default the URL ADTF_REMOTE_DEFAULT_HOST_URL is used.

Parameters
[in]bEnableenable or disable.
See also
adtf::services::ant::IRPCObjectServerRegistry, SetRPCURL.

◆ EnableSampleStreamTracer()

void EnableSampleStreamTracer ( bool  bEnable = true)

Enables the sample stream tracer core object creation.

Per default the creation is disabled.

Parameters
[in]bEnableenable or disable.
See also
adtf::services::bat::ISampleStreamTracer.

◆ EnableSessionManagerCreation()

void EnableSessionManagerCreation ( bool  bEnable = true)

Enables the session manager core object creation.

Per default the creation is disabled. Per default the CID used to create is CID_ADTF_SESSION_MANAGER.

Parameters
[in]bEnableenable or disable.
See also
adtf::services::ant::ISessionManager, SetSessionManagerCID.

◆ Exec() [1/2]

tResult Exec ( int8_t  nFirstRunLevel,
const adtf::util::cCommandLine &  oCommandLine,
std::function< void()>  fnStartup 
)

Launches the system and create a adtf::base::ant::cADTFRuntime.

The System main loop is executed until the runlevel RL_Shutdown is set.

If a IApplication is registered while reaching nFirstRunLevel the blocking Exec call is forwarded to the IApplication::Exec. If the runlevel change to nFirstRunLevel fails, the function returns. The main loop will not be executed.

Parameters
[in]nFirstRunLevelFirst run level to reach to startup.
[in]oCommandLineCommandline passed to the created cADTFRuntime.
[in]fnStartupStartup function which will be called after main loop is started.
Returns
Standard Result Code
Return values
ERR_INVALID_STATEa runtime is already created within singleton _runtime
See also
adtf::base::ant::cADTFRuntime.

◆ Exec() [2/2]

Exec ( int8_t  nFirstRunLevel,
const adtf::util::cCommandLine &  oCommandLine,
std::function< void()>  fnStartup,
bool  bContinueInCaseOfError 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Remarks
If bContinueInCaseOfError is set and an error occurred in runlevel RLSession or above then keep running at one runlevel below the erroneous one. Otherwise return as mentioned above.
Parameters
[in]bContinueInCaseOfErrorIn case of an error, continue running at one level below the runlevel where the error occurred.

◆ ExecMicro()

tResult ExecMicro ( adtf::base::quiet::IADTFRuntime::tADTFMicroRunLevel  nFirstMicroRunLevel,
const adtf::util::cCommandLine &  oCommandLine,
std::function< void()>  fnStartup,
bool  bContinueInCaseOfError 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Remarks
If bContinueInCaseOfError is set and an error occurred in runlevel RLSession or above then keep running at one runlevel below the erroneous one. Otherwise return as mentioned above.
Parameters
[in]bContinueInCaseOfErrorIn case of an error, continue running at one level below the runlevel where the error occurred.
Remarks
nFirstMicroRunLevel specifies the initial runlevel as a micro runlevel.
If bContinueInCaseOfError is set and an error occurred in runlevel RLSession or above then keep running at one runlevel below the erroneous one. Otherwise return as mentioned above.
Parameters
[in]bContinueInCaseOfErrorIn case of an error, continue running at one level below the runlevel where the error occurred.

◆ Launch() [1/2]

tResult Launch ( adtf::ucom::ant::IRuntime oRuntime)

Launches the system and its core objects to an existing runtime.

Parameters
[in]oRuntimeruntime to lnch the core objects to.
Returns
Standard Result Code

◆ Launch() [2/2]

tResult Launch ( const adtf::util::cCommandLine &  oCommandLine)

Launches the system and create a adtf::base::ant::cADTFRuntime.

Parameters
[in]oCommandLineCommandline passed to the created cADTFRuntime.
Returns
Standard Result Code
Return values
ERR_INVALID_STATEa runtime is already created within singleton _runtime
See also
adtf::base::ant::cADTFRuntime.

◆ SetAdditionalInitFunction()

void SetAdditionalInitFunction ( std::function< tResult()>  fnInitFunction)

Adds an additional Initialization function that is called right atfer the logging has been set up.

Parameters
[in]fnInitFunctionThe additional init function.

◆ SetADTFCorePlugin()

void SetADTFCorePlugin ( const util::cFilename &  strCorePluginPath)

Sets the path to the adtf_core.plugin which contains the the core objects implementations.

These core objects are essentials to define the ADTF System.

Parameters
[in]strCorePluginPathPath to the core plugin

◆ SetADTFDIR()

void SetADTFDIR ( const util::cFilename &  strADTFDIR)

Sets the environment variable ADTF_DIR.

Parameters
[in]strADTFDIRADTF_DIR variable

◆ SetLoggingParameter() [1/2]

void SetLoggingParameter ( unsigned int  nStdOutLogLevel,
unsigned int  nStdErrLogLevel,
unsigned int  nDebugLogLevel,
tTimeStamp  tmQueueProcessingInterval 
)

Sets the logging parameter of the Logging serive These core objects define the ADTF System.

Parameters
[in]nStdOutLogLevelLogLevel for the stdout. (see tLogLevel).
[in]nStdErrLogLevelLogLevel for the stderr. (see tLogLevel).
[in]nDebugLogLevelLogLevel for the OutputDebugString withing Visual Studio. (see tLogLevel).
[in]tmQueueProcessingIntervalInterval for asynchronously logging outputs. by default it is set to 0 (synchronously enabled)
See also
adtf::services::ant::ILogging, EnableLogging.

◆ SetLoggingParameter() [2/2]

void SetLoggingParameter ( unsigned int  nStdOutMinLogLevel,
unsigned int  nStdOutMaxLogLevel,
unsigned int  nStdErrMinLogLevel,
unsigned int  nStdErrMaxLogLevel,
unsigned int  nDebugMinLogLevel,
unsigned int  nDebugMaxLogLevel,
tTimeStamp  tmQueueProcessingInterval 
)

Sets the log levels that are output via a specific channel.

Parameters
[in]nStdOutMinLogLevelMinimum LogLevel for the stdout. (see tLogLevel).
[in]nStdOutMaxLogLevelMaximum LogLevel for the stdout. (see tLogLevel).
[in]nStdErrMinLogLevelMinimum LogLevel for the stderr. (see tLogLevel).
[in]nStdErrMaxLogLevelMaximum LogLevel for the stderr. (see tLogLevel).
[in]nDebugMinLogLevelMinimum LogLevel for the OutputDebugString withing Visual Studio. (see tLogLevel).
[in]nDebugMaxLogLevelMaximum LogLevel for the OutputDebugString withing Visual Studio. (see tLogLevel).
[in]tmQueueProcessingIntervalInterval for asynchronously logging outputs. by default it is set to 0 (synchronously enabled)
See also
adtf::services::ant::ILogging, EnableLogging.

◆ SetRPCURL()

void SetRPCURL ( const util::cString &  strRPCUrl)

Sets the URL for the rpc object registry core object.

Per default the URL ADTF_REMOTE_DEFAULT_HOST_URL is used.

Parameters
[in]strRPCUrlURL to set.
See also
adtf::services::ant::IRPCObjectServerRegistry, EnableRPCObjectRegistry.

◆ SetSessionManagerCID()

void SetSessionManagerCID ( const util::cString &  strSessionManagerCID)

Sets the class id used for creation of the session manager core object (EnableSessionManagerCreation).

Per default the class id is set to CID_ADTF_SESSION_MANAGER.

Parameters
[in]strSessionManagerCIDClass id of the session manager to create.
See also
adtf::services::ant::ISessionManager, EnableSessionManagerCreation.