ADTF  3.18.2
IRuntimeabstract

The IRuntime interface controls global system startup and shutdown. More...

Inheritance diagram for IRuntime:
[legend]

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")
 Marks the IRuntime to be castable with the ucom_cast<> More...
 
virtual tResult SetRunLevel (int8_t nRunLevel, bool bWait=true)=0
 Set run level. More...
 
virtual int8_t GetRunLevel () const =0
 Get current run level. More...
 
virtual tResult RegisterClassFactory (const iobject_ptr< const IClassFactory > &pClassFactory, uint32_t ui32Flags=0)=0
 Register class at class registry The RegisterClass method registers all classes of the given factory at the class registry. More...
 
virtual tResult UnregisterClassFactory (const iobject_ptr< const IClassFactory > &pClassFactory)=0
 Unregister a class factory from class registry. More...
 
virtual tResult GetClasses (iobject_enum< const IClassInfo > &lstOfClasses) const =0
 Returns a list of classes. More...
 
virtual tResult GetClassFactories (iobject_enum< const IClassFactory > &lstOfClassFactories) const =0
 Gets a list for all registered class factories. More...
 
virtual tResult RegisterObject (const iobject_ptr< IObject > &pObject, const char *strNameOID, int8_t nRunLevel, uint32_t ui32Flags=0)=0
 Register object at object registry. More...
 
virtual tResult UnregisterObject (const iobject_ptr< IObject > &pObject, const tChar *strNameOID="")=0
 Unregister object from object registry. More...
 
virtual tResult GetObjects (iobject_enum< IObject > &lstOfObjects) const =0
 Get a list (enumeration) of registered instances. More...
 
virtual tResult RegisterPlugin (const char *strUrl, int8_t nRunLevel, iobject_ptr< IPluginInfo > &pPluginInfo, uint32_t ui32Flags=0)=0
 Register plugin at the plugin registry. More...
 
virtual tResult UnregisterPlugin (const iobject_ptr< IPluginInfo > &pPluginInfo, uint32_t ui32Flags=0)=0
 Unregister plugin from plugin registry. More...
 
virtual tResult UnregisterAllPlugins (int8_t nRunLevel, uint32_t ui32Flags=0)=0
 Unregister all plugin from plugin registry. More...
 
virtual tResult GetPlugins (iobject_enum< const IPluginInfo > &lstPluginInfos) const =0
 Gets a object reference list of registered plugins. More...
 
virtual tResult RegisterHook (IRuntimeHook &oHook)=0
 Register hook. More...
 
virtual tResult UnregisterHook (IRuntimeHook &oHook)=0
 Unregister hook. More...
 
virtual tResult GetObject (iobject_ptr< IObject > &pObject, const char *strNameOID) const =0
 Get registered object from object registry. More...
 
virtual tResult GetObject (iobject_ptr< IObject > &pObject) const =0
 Get registered object from object registry by interface. More...
 
virtual tResult CreateInstance (const char *strCID, iobject_ptr< IObject > &pObject, const tChar *strNameOfObject="") const =0
 Creates a new instance of an object. More...
 
- Public Member Functions inherited from IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast() More...
 

Protected Member Functions

 ~IRuntime ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 
- Protected Member Functions inherited from IObject
 ~IObject ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Detailed Description

The IRuntime interface controls global system startup and shutdown.

Definition at line 110 of file runtime_intf.h.

Member Enumeration Documentation

◆ tChangeRunLevelFlags

enum tChangeRunLevelFlags : uint32_t

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.

Definition at line 240 of file runtime_intf.h.

◆ tClassRegistryFlags

enum tClassRegistryFlags : uint32_t

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.

Definition at line 291 of file runtime_intf.h.

◆ tObjectRegistryFlags

enum tObjectRegistryFlags : uint32_t
Enumerator
ORF_None 
ORF_MarkedForDeletion 
ORF_ServiceIsShutdown 
ORF_RegisterOnChangingRL 

Definition at line 272 of file runtime_intf.h.

◆ tPluginFlags

enum tPluginFlags : uint8_t

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

Definition at line 281 of file runtime_intf.h.

◆ tRunLevel

enum tRunLevel : int8_t

Run levels.

Enumerator
RL_Shutdown 

The system is shut down.

RL_Internal 

Invalid run level that signals unmanaged modules.

Definition at line 121 of file runtime_intf.h.

◆ tRuntimeHookId

enum tRuntimeHookId : uint32_t

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.

Definition at line 131 of file runtime_intf.h.

◆ tUnregisterObjectFlags

enum tUnregisterObjectFlags : uint32_t

Run level change flags.

Enumerator
UOF_None 

Unused.

UOF_Manually 

Manually Unregistered Object.

UOF_Automatically 

Automatically Unregistered Object by Runlevelchange.

Definition at line 259 of file runtime_intf.h.

Member Function Documentation

◆ ADTF_IID()

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 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.

Referenced by adtf::streaming::devil::add_graph_object().

◆ GetClasses()

virtual tResult 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 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 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 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.

Referenced by cKernelAndClockHelper::cKernelAndClockHelper(), sample_writer< DATA_TYPE, BASE >::sample_writer(), adtf::services::ant::adtf_register_macro(), adtf::services::ant::adtf_resolve_macros(), cSampleWriter::BeginStreaming(), adtf::services::elasto::get_player(), adtf::services::quiet::get_player(), adtf::services::ant::get_player(), adtf::services::bat::get_player(), qt_ui_filter< FILTERBASECLASS >::Init(), qt_ui_filter< FILTERBASECLASS, QTWINDOWBASECLASS >::Init(), qt_ui_service< SERVICEBASECLASS >::ServiceInit(), and qt_ui_service< SERVICEBASECLASS, QTWINDOWBASECLASS >::ServiceInit().

◆ GetObjects()

virtual tResult 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 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 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 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 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 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 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 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 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 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 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 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 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.