ADTF
Loading...
Searching...
No Matches
adtf::ucom::ant::IRuntime Class Referenceabstract

#include <runtime_intf.h>

Inherits adtf::ucom::ant::IObject.

Public Types

enum  tRunLevel : int8_t { RL_Shutdown = 0 , RL_Internal = 99 }
 Run levels. More...
 
enum  tRuntimeHookId : uint32_t {
  RHI_Create , RHI_Start , RHI_Stop , RHI_Destroy ,
  RHI_RegisterObject , RHI_UnregisterObject , RHI_RegisterClass , RHI_UnregisterClass ,
  RHI_RegisterPlugin , RHI_UnregisterPlugin , RHI_LoadPlugin , RHI_CreateInstance ,
  RHI_ServiceStarting , RHI_ServiceStarted , RHI_ServiceStopping , RHI_ServiceStopped ,
  RHI_RunLevelPreIncrement , RHI_RunLevelPostIncrement , RHI_RunLevelPreDecrement , RHI_RunLevelPostDecrement ,
  RHI_RunLevelIncrementing , RHI_RunLevelDecrementing
}
 Runtime hook identifiers. More...
 
enum  tChangeRunLevelFlags : uint32_t {
  CRLF_None = 0x0 , CRLF_PreIncrementLevel = 0x1 , CRLF_PostIncrementLevel = 0x2 , CRLF_PreDecrementLevel = 0x4 ,
  CRLF_PostDecrementLevel = 0x8
}
 Run level change flags. More...
 
enum  tUnregisterObjectFlags : uint32_t { UOF_None = 0x0 , UOF_Manually = 0x1 , UOF_Automatically = 0x2 }
 Run level change flags. More...
 
enum  tObjectRegistryFlags : uint32_t { ORF_None = 0 , ORF_MarkedForDeletion = 0x1 , ORF_ServiceIsShutdown = 0x2 , ORF_RegisterOnChangingRL = 0x4 }
 
enum  tPluginFlags : uint8_t { PF_NONE = 0x0 , PF_UNMANAGED = 0x1 , PF_MARKEDFORDELETION = 0x2 }
 InternalFlags. More...
 
enum  tClassRegistryFlags : uint32_t { CRF_None = 0x0 , CRF_NoHookOnCreation = 0x1 , CRF_FastCreation = 0x2 , CRF_NoAutoDeregistration = 0x4 }
 Flags to affect the creation speed of classes. More...
 

Public Member Functions

 ADTF_IID (IRuntime, "runtime.ant.ucom.adtf.iid")
 
virtual tResult SetRunLevel (int8_t nRunLevel, bool bWait=true)=0
 
virtual int8_t GetRunLevel () const =0
 
virtual tResult RegisterClassFactory (const iobject_ptr< const IClassFactory > &pClassFactory, uint32_t ui32Flags=0)=0
 
virtual tResult UnregisterClassFactory (const iobject_ptr< const IClassFactory > &pClassFactory)=0
 
virtual tResult GetClasses (iobject_enum< const IClassInfo > &lstOfClasses) const =0
 
virtual tResult GetClassFactories (iobject_enum< const IClassFactory > &lstOfClassFactories) const =0
 
virtual tResult RegisterObject (const iobject_ptr< IObject > &pObject, const char *strNameOID, int8_t nRunLevel, uint32_t ui32Flags=0)=0
 
virtual tResult UnregisterObject (const iobject_ptr< IObject > &pObject, const tChar *strNameOID="")=0
 
virtual tResult GetObjects (iobject_enum< IObject > &lstOfObjects) const =0
 
virtual tResult RegisterPlugin (const char *strUrl, int8_t nRunLevel, iobject_ptr< IPluginInfo > &pPluginInfo, uint32_t ui32Flags=0)=0
 
virtual tResult UnregisterPlugin (const iobject_ptr< IPluginInfo > &pPluginInfo, uint32_t ui32Flags=0)=0
 
virtual tResult UnregisterAllPlugins (int8_t nRunLevel, uint32_t ui32Flags=0)=0
 
virtual tResult GetPlugins (iobject_enum< const IPluginInfo > &lstPluginInfos) const =0
 
virtual tResult RegisterHook (IRuntimeHook &oHook)=0
 
virtual tResult UnregisterHook (IRuntimeHook &oHook)=0
 
virtual tResult GetObject (iobject_ptr< IObject > &pObject, const char *strNameOID) const =0
 
virtual tResult GetObject (iobject_ptr< IObject > &pObject) const =0
 
virtual tResult CreateInstance (const char *strCID, iobject_ptr< IObject > &pObject, const tChar *strNameOfObject="") const =0
 
- Public Member Functions inherited from adtf::ucom::ant::IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 

Protected Member Functions

 ~IRuntime ()=default
 Protected destructor --> Only the final implementation can be destroyed!
 
- Protected Member Functions inherited from adtf::ucom::ant::IObject
 ~IObject ()=default
 Protected destructor --> Only the final implementation can be destroyed!
 

Detailed Description

The IRuntime interface controls global system startup and shutdown.

Member Enumeration Documentation

◆ tChangeRunLevelFlags

Run level change flags.

Enumerator
CRLF_None 

Unused.

CRLF_PreIncrementLevel 

Called before the run level is incremented.

CRLF_PostIncrementLevel 

Called after the run level was incremented.

CRLF_PreDecrementLevel 

Called before the run level is decremented.

CRLF_PostDecrementLevel 

Called after the run level was decremented.

◆ tClassRegistryFlags

Flags to affect the creation speed of classes.

Enumerator
CRF_None 

No special treatment.

CRF_NoHookOnCreation 

The runtime hooks don't get called.

CRF_FastCreation 

The class is placed at the front of the classlist.

CRF_NoAutoDeregistration 

The class will be registered for the current Run level and will be automatically unregistered on post decreasing this Run level.

◆ tObjectRegistryFlags

Enumerator
ORF_None 
ORF_MarkedForDeletion 
ORF_ServiceIsShutdown 
ORF_RegisterOnChangingRL 

◆ tPluginFlags

InternalFlags.

Enumerator
PF_NONE 

no flags, default setting

PF_UNMANAGED 

if plugin is unloaded, also remove entry from registration. this makes sense, if a plugin is registered manually through an api call.

PF_MARKEDFORDELETION 

if plugin is unloaded, this is the flag for deletion

◆ tRunLevel

Run levels.

Enumerator
RL_Shutdown 

The system is shut down.

RL_Internal 

Invalid run level that signals unmanaged modules.

◆ tRuntimeHookId

Runtime hook identifiers.

Enumerator
RHI_Create 

Called after the runtime instance was created.

RHI_Start 

Called after the runtime instance was started.

RHI_Stop 

Called before the runtime instance is stopped.

RHI_Destroy 

Called before the runtime instance is destroyed.

RHI_RegisterObject 

Called after an object has been registered.

RHI_UnregisterObject 

Called before an object is unregistered.

RHI_RegisterClass 

Called after a class has been registered.

RHI_UnregisterClass 

Called before a class is unregistered.

RHI_RegisterPlugin 

Called after a plugin has been registered, after it has been loaded, see RHI_LoadPlugin.

RHI_UnregisterPlugin 

Called before a plugin is unregistered.

RHI_LoadPlugin 

Called after a plugin has been loaded.

RHI_CreateInstance 

Called after an instance has been created.

  • pObject of RuntimeHook is set to the newly created object.
  • IRuntimeHook::tHookInfo::pvData is a const char* pointer and contains the class id/OID of the object.
RHI_ServiceStarting 

Called before a service is started.

RHI_ServiceStarted 

Called after a service was started.

RHI_ServiceStopping 

Called before a service is stopped.

RHI_ServiceStopped 

Called after a service has been stopped.

RHI_RunLevelPreIncrement 

Called before the run level is incremented.

RHI_RunLevelPostIncrement 

Called after the run level was incremented.

RHI_RunLevelPreDecrement 

Called before the run level is decremented.

RHI_RunLevelPostDecrement 

Called after the run level was decremented.

RHI_RunLevelIncrementing 

Called before the run level is incrementing.

RHI_RunLevelDecrementing 

Called while the run level is decrementing.

◆ tUnregisterObjectFlags

Run level change flags.

Enumerator
UOF_None 

Unused.

UOF_Manually 

Manually Unregistered Object.

UOF_Automatically 

Automatically Unregistered Object by Runlevelchange.

Member Function Documentation

◆ ADTF_IID()

adtf::ucom::ant::IRuntime::ADTF_IID ( IRuntime ,
"runtime.ant.ucom.adtf.iid"  )

Marks the IRuntime to be castable with the ucom_cast<>

See also
ADTF_IID(_interface, _striid)

◆ CreateInstance()

virtual tResult adtf::ucom::ant::IRuntime::CreateInstance ( const char * strCID,
iobject_ptr< IObject > & pObject,
const tChar * strNameOfObject = "" ) const
pure virtual

Creates a new instance of an object. The CreateInstance method creates a single uninitialized object of the class associated with a specified class identifier.

Parameters
[in]strCIDClass identifier (CID) identifying the type of the object to create
[out]pObjectShared pointer that receives the created instance as base pointer of type IObject. Upon successful return, o_pObject points to the IObject interface of the requested object. Upon failure, nullptr == o_pObject.Get().
[in]strNameOfObjectName of the object to set
Returns
Returns a standard result code.

◆ GetClasses()

virtual tResult adtf::ucom::ant::IRuntime::GetClasses ( iobject_enum< const IClassInfo > & lstOfClasses) const
pure virtual

Returns a list of classes.

Parameters
[out]lstOfClassespush interface to an list af IClassInfo Container (see i.e. object_list)
Returns
Returns a standard result code.

◆ GetClassFactories()

virtual tResult adtf::ucom::ant::IRuntime::GetClassFactories ( iobject_enum< const IClassFactory > & lstOfClassFactories) const
pure virtual

Gets a list for all registered class factories.

Parameters
[out]lstOfClassFactoriespush interface to an list af IClassFactory Container (see i.e. object_list)
Returns
Returns a standard result code.

◆ GetObject() [1/2]

virtual tResult adtf::ucom::ant::IRuntime::GetObject ( iobject_ptr< IObject > & pObject) const
pure virtual

Get registered object from object registry by interface.

Parameters
[out]pObjectShared pointer that receives the identified object as base pointer of type IObject. Upon successful return, pObject points to the IObject interface of the requested object. Upon failure, nullptr == pObject.Get().
Returns
Returns a standard result code.
Return values
ERR_NOERROREverything went fine.
ERR_INVALID_STATEThe runtime hasn't been initialized yet.
ERR_NOT_FOUNDObject identified by strOID is unknown to the object registry.

◆ GetObject() [2/2]

virtual tResult adtf::ucom::ant::IRuntime::GetObject ( iobject_ptr< IObject > & pObject,
const char * strNameOID ) const
pure virtual

Get registered object from object registry.

Parameters
[in]strNameOIDObject instance identifier. If nullptr, the first object matching the requested interface type is returned.
[out]pObjectShared pointer that receives the identified object as base pointer of type IObject. Upon successful return, o_pObject points to the IObject interface of the requested object. Upon failure, nullptr == o_pObject.Get().
Returns
Returns a standard result code.
Return values
ERR_NOERROREverything went fine.
ERR_INVALID_STATEThe runtime hasn't been initialized yet.
ERR_NOT_FOUNDObject identified by strOID is unknown to the object registry.

◆ GetObjects()

virtual tResult adtf::ucom::ant::IRuntime::GetObjects ( iobject_enum< IObject > & lstOfObjects) const
pure virtual

Get a list (enumeration) of registered instances. The EnumObjects method enumerates all registered instances of the object registry.

Parameters
[out]lstOfObjectspointer to a iobject_enum where to push the objects (see i.e. adtf::ucom::ant::object_list)
Returns
Returns a standard result code.

◆ GetPlugins()

virtual tResult adtf::ucom::ant::IRuntime::GetPlugins ( iobject_enum< const IPluginInfo > & lstPluginInfos) const
pure virtual

Gets a object reference list of registered plugins. The GetPlugins method enumerates all registered plugins of the plugin registry.

Parameters
[out]lstPluginInfosreference to a iobject_enum where to push the plugin references (see i.e. object_list)
Returns
Returns a standard result code.

◆ GetRunLevel()

virtual int8_t adtf::ucom::ant::IRuntime::GetRunLevel ( ) const
pure virtual

Get current run level. The GetRunLevel method returns the current run level.

Returns
Returns the current run level.

◆ RegisterClassFactory()

virtual tResult adtf::ucom::ant::IRuntime::RegisterClassFactory ( const iobject_ptr< const IClassFactory > & pClassFactory,
uint32_t ui32Flags = 0 )
pure virtual

Register class at class registry The RegisterClass method registers all classes of the given factory at the class registry.

Parameters
pClassFactory[in] Pointer to the class factory instance.
ui32Flags[in] Registration flags (see IRuntime::tClassRegistryFlags for an explanation of the flags).
Returns
Returns a standard result code.

◆ RegisterHook()

virtual tResult adtf::ucom::ant::IRuntime::RegisterHook ( IRuntimeHook & oHook)
pure virtual

Register hook. The RegisterHook method registers a hook interface.

Parameters
[in]oHookRefernce to the hook interface to be registered.
Returns
Returns a standard result code.

◆ RegisterObject()

virtual tResult adtf::ucom::ant::IRuntime::RegisterObject ( const iobject_ptr< IObject > & pObject,
const char * strNameOID,
int8_t nRunLevel,
uint32_t ui32Flags = 0 )
pure virtual

Register object at object registry. The RegisterObject method registers an object at the object registry.

Parameters
[in]pObjectPointer to the object instance.
[in]strNameOIDUnique identifier for the registered object.
[in]nRunLevelRequired runlevel.
[in]ui32FlagsRegistration flags. (for internal use only)
Returns
Returns a standard result code.

◆ RegisterPlugin()

virtual tResult adtf::ucom::ant::IRuntime::RegisterPlugin ( const char * strUrl,
int8_t nRunLevel,
iobject_ptr< IPluginInfo > & pPluginInfo,
uint32_t ui32Flags = 0 )
pure virtual

Register plugin at the plugin registry. The RegisterPlugin method registers a plugin at the plugin registry.

Parameters
[in]strUrlUrl of plugin to be registered.
[in]nRunLevelPlugin runlevel.
[in]pPluginInfoPointer to plugininfo interface.
[in]ui32FlagsRegistration flags.
Returns
Returns a standard result code.

◆ SetRunLevel()

virtual tResult adtf::ucom::ant::IRuntime::SetRunLevel ( int8_t nRunLevel,
bool bWait = true )
pure virtual

Set run level. The SetRunLevel method changes the global run level and manages all services dependencies.

Parameters
[in]nRunLevelrunlevel to set.
[in]bWaitwait until runlevel is changed
Returns
Returns a standard result code.

◆ UnregisterAllPlugins()

virtual tResult adtf::ucom::ant::IRuntime::UnregisterAllPlugins ( int8_t nRunLevel,
uint32_t ui32Flags = 0 )
pure virtual

Unregister all plugin from plugin registry. The UnregisterAllPlugins method unregisters all plugin from the plugin registry.

Parameters
nRunLevel[in] Runlevel information.
ui32Flags[in] Unregistration flags.
Returns
Returns a standard result code.

◆ UnregisterClassFactory()

virtual tResult adtf::ucom::ant::IRuntime::UnregisterClassFactory ( const iobject_ptr< const IClassFactory > & pClassFactory)
pure virtual

Unregister a class factory from class registry.

All classes this factory is able to construct will be unregistered.

Parameters
[in]pClassFactoryclassfactory reference to unregister.
Returns
Returns a standard result code.

◆ UnregisterHook()

virtual tResult adtf::ucom::ant::IRuntime::UnregisterHook ( IRuntimeHook & oHook)
pure virtual

Unregister hook. The UnregisterHook method unregisters a hook interface.

Parameters
[in]oHookRefernce to the hook interface to be registered..
Returns
Returns a standard result code.

◆ UnregisterObject()

virtual tResult adtf::ucom::ant::IRuntime::UnregisterObject ( const iobject_ptr< IObject > & pObject,
const tChar * strNameOID = "" )
pure virtual

Unregister object from object registry. The UnregisterObject method unregisters an object from the object registry.

Parameters
[in]pObjectPointer to the object instance.
[in]strNameOIDUnique identifier for the registered instance.
Returns
Returns a standard result code.

◆ UnregisterPlugin()

virtual tResult adtf::ucom::ant::IRuntime::UnregisterPlugin ( const iobject_ptr< IPluginInfo > & pPluginInfo,
uint32_t ui32Flags = 0 )
pure virtual

Unregister plugin from plugin registry. The UnregisterPlugin method unregisters a plugin from the plugin registry.

Parameters
pPluginInfo[in] object reference to a plugin info instance.
ui32Flags[in] Unregistration flags.
Returns
Returns a standard result code.

The documentation for this class was generated from the following file: