Class CAppControl#
Defined in File core_control.h
Inheritance Relationships#
Base Types#
public sdv::IInterfaceAccess(Struct IInterfaceAccess)public sdv::app::IAppControl(Struct IAppControl)public sdv::app::IAppOperation(Struct IAppOperation)public sdv::app::IAppShutdownRequest(Struct IAppShutdownRequest)
Class Documentation#
-
class CAppControl : public sdv::IInterfaceAccess, public sdv::app::IAppControl, public sdv::app::IAppOperation, public sdv::app::IAppShutdownRequest#
Application control class.
CAppControl redefined.
The application control class is responsible for the startup and shutdown of the system. The startup behavior can be influenced through the provided startup configuration. Dependable on the configuration, the core context is either server operated (for main, isolated or maintenance applications) or locally operated (for standalone, external or essential application).
In case of a server operated startup sequence, the following startup procedure takes place:
Core services are started
Installation manifests are loaded (not for maintenance applications)
This registers the available component classes and corresponding modules
IPC and RPC services are started
Switch system to configuration mode
Installed system configurations are loaded and components are started
This starts all system, device and interface abstraction level components with corresponding configuration.
Installed user configuration will be loaded and components are started
This will start the vehicle functions (in isolated processed where applicable).
Switch system to running mode
In case of a locally operated startup sequence, the following startup procedure takes place:
Core services are started
Core installation manifest is loaded
This registers the available component classes and corresponding modules for core components
For external application: RPC client is started
Switch system to configuration mode
Modules from provided configuration are loaded
This registers the available component classes and corresponding modules
Installed user configuration will be loaded and components are started
This will start the vehicle functions.
Switch system to running mode
Public Functions
-
CAppControl() = default#
Constructor.
-
virtual bool Startup(const sdv::u8string &ssConfig, IInterfaceAccess *pEventHandler) override#
Start the application. Overload of sdv::app::IAppControl::Startup.
The core will prepare for an application start based on the provided configuration. Per default, the application will be in running mode after successful startup.
- Parameters:
ssConfig – [in] String containing the configuration to be used by the core during startup. This configuration is optional. If not provided the application runs as standalone application without any RPC support.
pEventHandler – [in] Pointer to the event handler receiving application events. For the handler to receive events, the handler needs to expose the IAppEvent interface. This pointer is optionally and can be NULL.
- Returns:
Returns ‘true’ on successful start-up and ‘false’ on failed startup.
-
virtual void RunLoop() override#
Running loop until shutdown request is triggered.
-
virtual void Shutdown(bool bForce) override#
Initiate a shutdown of the application. Overload of sdv::app::IAppControl::Shutdown.
The objects will be called to shutdown allowing them to clean up and gracefully shutdown. If, for some reason, the object cannot shut down (e.g. pointers are still in use or threads are not finalized), the object will be kept alive and the application state will stay in shutting-down-state. In that case the exception is called. A new call to the shutdown function using the force-flag might force a shutdown. Alternatively the application can wait until the application state changes to not-started.
Remark
Application shutdown is only possible when all components are released.
- Parameters:
bForce – [in] When set, forces an application shutdown. This might result in loss of data and should only be used as a last resort.
-
virtual void RequestShutdown() override#
Request shutdown. Overload of sdv::app::IAppShutdownRequest::RequestShutdown.
-
virtual sdv::app::EAppOperationState GetOperationState() const override#
Get the current operation state. This information is also supplied through the event handler function. Overload of sdv::app::IAppOperation::GetOperationState.
- Returns:
Returns the operation state of the application.
-
virtual void SetConfigMode() override#
Switch from running mode to the configuration mode. Overload of sdv::app::IAppOperation::SetConfigMode.
-
virtual void SetRunningMode() override#
Switch from the configuration mode to the running mode. Overload of sdv::app::IAppOperation::SetRunningMode.
-
void DisableAutoConfigUpdate()#
Disable the current auto update feature if enabled in the system settings.
-
void EnableAutoConfigUpdate()#
Enable the current auto update feature if enabled in the system settings.
-
void TriggerConfigUpdate()#
Trigger the config update if enabled in the system settings.
-
inline virtual sdv::app::EAppOperationState GetOperationState() const
Application control is only in configuration state.
- Returns:
Returns the operation state of the application.