ADTF
|
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 | |
cADTFSystem & | operator= (const cADTFSystem &)=delete |
copy operator | |
cADTFSystem (cADTFSystem &&)=delete | |
move CTOR | |
cADTFSystem & | operator= (cADTFSystem &&)=delete |
move operator | |
Private Member Functions | |
A_UTILS_D (cADTFSystem) | |
pimpl | |
ADTF System Creation Class.
Definition at line 31 of file adtf_system.h.
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.
[in] | bEnable | enable or disable. |
[in] | eLevel | level of auto quit. |
void EnableLogging | ( | bool | bEnable = true | ) |
Enables the logging core object creation.
Per default the creation is disabled.
[in] | bEnable | enable or disable. |
void EnableMacroResolver | ( | bool | bEnable = true | ) |
Enables macro resolver core object creation.
Per default the creation is disabled.
[in] | bEnable | enable or disable. |
void EnableProfiler | ( | bool | bEnable = true , |
unsigned int | nPort = 28077 , |
||
const char * | strDumpFile = nullptr |
||
) |
Enables the profiler.
[in] | bEnable | enable or disable. |
[in] | nPort | The listening port that the GUI can connect on, 0 = disable remote profiling. |
[in] | strDumpFile | If set, profiling will be enabled right from the start and profiling data will be dumped to the given file during shutdown. |
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.
[in] | bEnable | enable or disable. |
void EnableSampleStreamTracer | ( | bool | bEnable = true | ) |
Enables the sample stream tracer core object creation.
Per default the creation is disabled.
[in] | bEnable | enable or disable. |
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.
[in] | bEnable | enable or disable. |
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.
[in] | nFirstRunLevel | First run level to reach to startup. |
[in] | oCommandLine | Commandline passed to the created cADTFRuntime. |
[in] | fnStartup | Startup function which will be called after main loop is started. |
ERR_INVALID_STATE | a runtime is already created within singleton _runtime |
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.
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.[in] | bContinueInCaseOfError | In case of an error, continue running at one level below the runlevel where the error occurred. |
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.
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.[in] | bContinueInCaseOfError | In case of an error, continue running at one level below the runlevel where the error occurred. |
nFirstMicroRunLevel
specifies the initial runlevel as a micro runlevel. 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.[in] | bContinueInCaseOfError | In case of an error, continue running at one level below the runlevel where the error occurred. |
tResult Launch | ( | adtf::ucom::ant::IRuntime & | oRuntime | ) |
Launches the system and its core objects to an existing runtime.
[in] | oRuntime | runtime to lnch the core objects to. |
tResult Launch | ( | const adtf::util::cCommandLine & | oCommandLine | ) |
Launches the system and create a adtf::base::ant::cADTFRuntime.
[in] | oCommandLine | Commandline passed to the created cADTFRuntime. |
ERR_INVALID_STATE | a runtime is already created within singleton _runtime |
void SetAdditionalInitFunction | ( | std::function< tResult()> | fnInitFunction | ) |
Adds an additional Initialization function that is called right atfer the logging has been set up.
[in] | fnInitFunction | The additional init function. |
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.
[in] | strCorePluginPath | Path to the core plugin |
void SetADTFDIR | ( | const util::cFilename & | strADTFDIR | ) |
Sets the environment variable ADTF_DIR.
[in] | strADTFDIR | ADTF_DIR variable |
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.
[in] | nStdOutLogLevel | LogLevel for the stdout. (see tLogLevel). |
[in] | nStdErrLogLevel | LogLevel for the stderr. (see tLogLevel). |
[in] | nDebugLogLevel | LogLevel for the OutputDebugString withing Visual Studio. (see tLogLevel). |
[in] | tmQueueProcessingInterval | Interval for asynchronously logging outputs. by default it is set to 0 (synchronously enabled) |
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.
[in] | nStdOutMinLogLevel | Minimum LogLevel for the stdout. (see tLogLevel). |
[in] | nStdOutMaxLogLevel | Maximum LogLevel for the stdout. (see tLogLevel). |
[in] | nStdErrMinLogLevel | Minimum LogLevel for the stderr. (see tLogLevel). |
[in] | nStdErrMaxLogLevel | Maximum LogLevel for the stderr. (see tLogLevel). |
[in] | nDebugMinLogLevel | Minimum LogLevel for the OutputDebugString withing Visual Studio. (see tLogLevel). |
[in] | nDebugMaxLogLevel | Maximum LogLevel for the OutputDebugString withing Visual Studio. (see tLogLevel). |
[in] | tmQueueProcessingInterval | Interval for asynchronously logging outputs. by default it is set to 0 (synchronously enabled) |
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.
[in] | strRPCUrl | URL to set. |
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.
[in] | strSessionManagerCID | Class id of the session manager to create. |