ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
runtime_intf.h
Go to the documentation of this file.
1
7#ifndef _ADTF_UCOM_ANT_RUNTIME_RUNTIME_HOOK_INTERFACE_INCLUDES_HEADER_
8#define _ADTF_UCOM_ANT_RUNTIME_RUNTIME_HOOK_INTERFACE_INCLUDES_HEADER_
9
10#ifdef GetObject
11#undef GetObject
12#endif
14
15namespace adtf
16{
17namespace ucom
18{
19namespace ant
20{
21
66
76class DOEXPORT IRuntimeHook
77{
78 public:
84 typedef struct
85 {
86 uint32_t idHook;
87 uint32_t ui32Param1;
88 uint32_t ui32Param2;
89 void* pvData;
90 size_t szData;
91 } tHookInfo;
92
93 public:
102 virtual tResult RuntimeHook(const tHookInfo& sHookInfo,
103 const iobject_ptr<IObject>& pObject) = 0;
104};
105
111class DOEXPORT IRuntime : public IObject
112{
113public:
118 ADTF_IID(IRuntime, "runtime.ant.ucom.adtf.iid");
119
120public:
122 enum tRunLevel : int8_t
123 {
126
129 };
130
239
258
261 {
263 UOF_None = 0x0,
264
267
270 };
271
280
282 enum tPluginFlags : uint8_t
283 {
284 PF_NONE = 0x0,
289 } ;
290
292 enum tClassRegistryFlags : uint32_t
293 {
295 CRF_None = 0x0,
296
299
302
305 };
306
307 public:
318 virtual tResult SetRunLevel(int8_t nRunLevel, bool bWait = true) = 0;
319
325 virtual int8_t GetRunLevel() const = 0;
326
337 uint32_t ui32Flags = 0) = 0;
338
350
358 virtual tResult GetClasses(iobject_enum<const IClassInfo>& lstOfClasses) const = 0;
359
369 virtual tResult GetClassFactories(iobject_enum<const IClassFactory>& lstOfClassFactories) const = 0;
370
384 const char* strNameOID,
385 int8_t nRunLevel,
386 uint32_t ui32Flags = 0) = 0;
387
397 const tChar* strNameOID = "") = 0;
398
408 virtual tResult GetObjects(iobject_enum<IObject>& lstOfObjects) const = 0;
409
422 virtual tResult RegisterPlugin(const char* strUrl,
423 int8_t nRunLevel,
424 iobject_ptr<IPluginInfo>& pPluginInfo,
425 uint32_t ui32Flags = 0) = 0;
426
436 virtual tResult UnregisterPlugin(const iobject_ptr<IPluginInfo>& pPluginInfo, uint32_t ui32Flags = 0) = 0;
437
447 virtual tResult UnregisterAllPlugins(int8_t nRunLevel,
448 uint32_t ui32Flags=0) = 0;
449
458 virtual tResult GetPlugins(iobject_enum<const IPluginInfo>& lstPluginInfos) const = 0;
459
469 virtual tResult RegisterHook(IRuntimeHook& oHook) = 0;
470
481
498 virtual tResult GetObject(iobject_ptr<IObject>& pObject, const char* strNameOID) const = 0;
512 virtual tResult GetObject(iobject_ptr<IObject>& pObject) const = 0;
513
527 virtual tResult CreateInstance(const char* strCID,
528 iobject_ptr<IObject>& pObject,
529 const tChar* strNameOfObject = "") const = 0;
530
531protected:
533 ~IRuntime() = default;
534};//class IRuntime
535
536}//namespace ant
537
538namespace spider
539{
540
541class DOEXPORT IRuntimeStartup : public ant::IObject
542{
543public:
548 ADTF_IID(IRuntimeStartup, "runtime_startup.spider.ucom.adtf.iid");
549
554 virtual bool StartupCompleted() const = 0;
555};
556
557}//namespace spider
558
559namespace vision
560{
561
562class DOEXPORT IRuntimeArguments : public ant::IObject
563{
564public:
569 ADTF_IID(IRuntimeArguments, "runtime_arguments.vision.ucom.adtf.iid");
570
576 virtual tResult GetArguments(const adtf::ucom::nitro::ifunction<tResult(const char*)>& oCallback) const = 0;
577};
578
579}// namespace vision
580
583
585using ant::IRuntime;
586
588
589}//namespace ucom
590}//namespace adtf
591
592#endif //_ADTF_UCOM_ANT_RUNTIME_RUNTIME_HOOK_INTERFACE_INCLUDES_HEADER_
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Base class for every interface type within the uCOM.
Definition object_intf.h:33
The IRuntimeHook interface provides a hook callback interface.
virtual tResult RuntimeHook(const tHookInfo &sHookInfo, const iobject_ptr< IObject > &pObject)=0
This method will be called at specific stages during runtime operation, see tRuntimeHookId.
The IRuntime interface controls global system startup and shutdown.
virtual tResult UnregisterHook(IRuntimeHook &oHook)=0
Unregister hook.
virtual tResult GetPlugins(iobject_enum< const IPluginInfo > &lstPluginInfos) const =0
Gets a object reference list of registered plugins.
virtual tResult CreateInstance(const char *strCID, iobject_ptr< IObject > &pObject, const tChar *strNameOfObject="") const =0
Creates a new instance of an object.
virtual tResult UnregisterAllPlugins(int8_t nRunLevel, uint32_t ui32Flags=0)=0
Unregister all plugin from plugin registry.
virtual tResult GetObjects(iobject_enum< IObject > &lstOfObjects) const =0
Get a list (enumeration) of registered instances.
virtual tResult SetRunLevel(int8_t nRunLevel, bool bWait=true)=0
Set run level.
virtual tResult RegisterObject(const iobject_ptr< IObject > &pObject, const char *strNameOID, int8_t nRunLevel, uint32_t ui32Flags=0)=0
Register object at object registry.
virtual tResult GetClasses(iobject_enum< const IClassInfo > &lstOfClasses) const =0
Returns a list of classes.
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 ...
virtual tResult UnregisterPlugin(const iobject_ptr< IPluginInfo > &pPluginInfo, uint32_t ui32Flags=0)=0
Unregister plugin from plugin registry.
virtual tResult RegisterPlugin(const char *strUrl, int8_t nRunLevel, iobject_ptr< IPluginInfo > &pPluginInfo, uint32_t ui32Flags=0)=0
Register plugin at the plugin registry.
tClassRegistryFlags
Flags to affect the creation speed of classes.
@ CRF_None
No special treatment.
@ CRF_FastCreation
The class is placed at the front of the classlist.
@ CRF_NoHookOnCreation
The runtime hooks don't get called.
@ CRF_NoAutoDeregistration
The class will be registered for the current Run level and will be automatically unregistered on post...
virtual tResult RegisterHook(IRuntimeHook &oHook)=0
Register hook.
virtual tResult GetClassFactories(iobject_enum< const IClassFactory > &lstOfClassFactories) const =0
Gets a list for all registered class factories.
virtual tResult GetObject(iobject_ptr< IObject > &pObject) const =0
Get registered object from object registry by interface.
tRuntimeHookId
Runtime hook identifiers.
@ RHI_RunLevelPreDecrement
Called before the run level is decremented.
@ RHI_RunLevelPostIncrement
Called after the run level was incremented.
@ RHI_RunLevelDecrementing
Called while the run level is decrementing.
@ RHI_ServiceStarted
Called after a service was started.
@ RHI_RunLevelIncrementing
Called before the run level is incrementing.
@ RHI_UnregisterPlugin
Called before a plugin is unregistered.
@ RHI_Start
Called after the runtime instance was started.
@ RHI_RunLevelPostDecrement
Called after the run level was decremented.
@ RHI_ServiceStopped
Called after a service has been stopped.
@ RHI_RegisterObject
Called after an object has been registered.
@ RHI_Stop
Called before the runtime instance is stopped.
@ RHI_ServiceStarting
Called before a service is started.
@ RHI_UnregisterObject
Called before an object is unregistered.
@ RHI_LoadPlugin
Called after a plugin has been loaded.
@ RHI_ServiceStopping
Called before a service is stopped.
@ RHI_RegisterPlugin
Called after a plugin has been registered, after it has been loaded, see RHI_LoadPlugin.
@ RHI_RunLevelPreIncrement
Called before the run level is incremented.
@ RHI_CreateInstance
Called after an instance has been created.
@ RHI_Destroy
Called before the runtime instance is destroyed.
@ RHI_Create
Called after the runtime instance was created.
@ RHI_RegisterClass
Called after a class has been registered.
@ RHI_UnregisterClass
Called before a class is unregistered.
tUnregisterObjectFlags
Run level change flags.
@ UOF_Automatically
Automatically Unregistered Object by Runlevelchange.
@ UOF_Manually
Manually Unregistered Object.
@ RL_Shutdown
The system is shut down.
@ RL_Internal
Invalid run level that signals unmanaged modules.
virtual tResult GetObject(iobject_ptr< IObject > &pObject, const char *strNameOID) const =0
Get registered object from object registry.
@ PF_MARKEDFORDELETION
if plugin is unloaded, this is the flag for deletion
@ PF_NONE
no flags, default setting
@ PF_UNMANAGED
if plugin is unloaded, also remove entry from registration.
ADTF_IID(IRuntime, "runtime.ant.ucom.adtf.iid")
Marks the IRuntime to be castable with the ucom_cast<>
tChangeRunLevelFlags
Run level change flags.
@ CRLF_PreIncrementLevel
Called before the run level is incremented.
@ CRLF_PostDecrementLevel
Called after the run level was decremented.
@ CRLF_PreDecrementLevel
Called before the run level is decremented.
@ CRLF_PostIncrementLevel
Called after the run level was incremented.
~IRuntime()=default
Protected destructor --> Only the final implementation can be destroyed!
virtual tResult UnregisterClassFactory(const iobject_ptr< const IClassFactory > &pClassFactory)=0
Unregister a class factory from class registry.
virtual int8_t GetRunLevel() const =0
Get current run level.
virtual tResult UnregisterObject(const iobject_ptr< IObject > &pObject, const tChar *strNameOID="")=0
Unregister object from object registry.
Interface definition for a container of objects.
Definition object_list.h:22
Base object pointer to realize binary compatible reference counting in interface methods.
Interface for functions that can be passed via IObject interfaces.
virtual bool StartupCompleted() const =0
ADTF_IID(IRuntimeStartup, "runtime_startup.spider.ucom.adtf.iid")
Marks the IRuntimeStartup to be castable with the ucom_cast<>
virtual tResult GetArguments(const adtf::ucom::nitro::ifunction< tResult(const char *)> &oCallback) const =0
Get the arguments passed to runtime.
ADTF_IID(IRuntimeArguments, "runtime_arguments.vision.ucom.adtf.iid")
Marks the IRuntimeArguments to be castable with the ucom_cast<>
Copyright © Audi Electronics Venture GmbH.
Namespace for all functionality provided since v3.0.
Namespace for all functionality provided since v3.18.
Namespace for the ADTF uCOM3 SDK.
Namespace for entire ADTF SDK.
uint32_t idHook
Defines event type (tRuntimeHookId)
void * pvData
optional data pointer.
uint32_t ui32Param1
Depends on idHook.
uint32_t ui32Param2
Depends on idHook.
size_t szData
size of the data provided through pvData.