ADTF
IServiceabstract

The IService interface provides defines methods for system services. More...

Inheritance diagram for IService:
[legend]

Public Types

enum  tServiceEvent : uint32_t {
  SE_Unknown = 0 , SE_Starting = 1 , SE_Ready = 2 , SE_Stopping = 3 ,
  SE_Stopped = 4 , SE_ChangeRunLevel = 5
}
 Service event identifiers called through IService::ServiceEvent. More...
 
enum class  tServiceState : uint32_t { Deinitialized = 0 , Initialized = 1 }
 

Public Member Functions

 ADTF_IID (IService, "service.ant.ucom.adtf.iid")
 Marks the IService to be castable with the ucom_cast<> More...
 
virtual tServiceState GetState () const =0
 
virtual tResult SetState (tServiceState eState)=0
 
virtual tResult ServiceEvent (int nEventId, uint32_t ui32Param1=0, uint32_t ui32Param2=0, void *pvData=nullptr, int szData=0)=0
 Signal service event. More...
 
- Public Member Functions inherited from IObjectInfo
 ADTF_IID (IObjectInfo, "object_info.ant.ucom.adtf.iid")
 Marks the IObjectInfo to be castable with the ucom_cast<> More...
 
virtual void SetOID (const char *strName)=0
 Sets the object instance name. More...
 
virtual const char * GetOID () const =0
 Returns the object instance name. More...
 
- Public Member Functions inherited from IClassInfo
 ADTF_IID (IClassInfo, "class_info.ant.ucom.adtf.iid")
 Marks the IClassInfo to be castable with the ucom_cast<> More...
 
virtual const char * GetCID () const =0
 Get class identifier. More...
 
virtual const char * GetCLabel () const =0
 
virtual iterator_adapter< const tDependencyDescription, pointer_iteratorGetCDependencies () const =0
 
virtual iterator_adapter< const tNamedVersion, pointer_iteratorGetCVersions () const =0
 
- 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

 ~IService ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 
- Protected Member Functions inherited from IObjectInfo
 ~IObjectInfo ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 
- Protected Member Functions inherited from IClassInfo
 ~IClassInfo ()=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 IService interface provides defines methods for system services.

Definition at line 23 of file service_intf.h.

Member Enumeration Documentation

◆ tServiceEvent

enum tServiceEvent : uint32_t

Service event identifiers called through IService::ServiceEvent.

Service Event Table:
nEventId

Description

SE_Starting ui32Param1 0
ui32Param2 0
pvData NULL terminated char array of the Service Instance Name
szData size of the Service Object Instance Name

This Event is signaled by a ucom::IRuntime. It is called while runtime is about to initialize a service.

SE_Ready ui32Param1 0
ui32Param2 0
pvData NULL terminated char array of the Service Instance Name
szData size of the Service Object Instance Name

This Event is signaled by a ucom::IRuntime. It is called after runtime initialized a service.

SE_Stopping ui32Param1 0
ui32Param2 0
pvData NULL terminated char array of the Service Instance Name
szData size of the Service Object Instance Name

This Event is signaled by a ucom::IRuntime. It is called while runtime is about to shutdown a service.

SE_Stopped ui32Param1 0
ui32Param2 0
pvData NULL terminated char array of the Service Instance Name
szData size of the Service Object Instance Name

This Event is signaled by a ucom::IRuntime. It is called after runtime shutdown a service.

SE_ChangeRunLevel ui32Param1 Number of IRuntime::tRunLevel
ui32Param2 Flags set with IRuntime::tChangeRunLevelFlags (pre-post condition)
pvData NULL
szData 0
This Event is signaled by a ucom::IRuntime. It is called while runtime is doing run level changes
Enumerator
SE_Unknown 

Unknown Event.

SE_Starting 

Service Staring Event.

see tServiceEvent.

SE_Ready 

Service Ready Event.

see tServiceEvent.

SE_Stopping 

Service Stopping Event.

see tServiceEvent.

SE_Stopped 

Service Stopped Event.

see tServiceEvent.

SE_ChangeRunLevel 

Runlevel Service Change Event.

see tServiceEvent.

Definition at line 161 of file service_intf.h.

Member Function Documentation

◆ ADTF_IID()

ADTF_IID ( IService  ,
"service.ant.ucom.adtf.iid"   
)

Marks the IService to be castable with the ucom_cast<>

See also
ADTF_IID(_interface, _striid)

◆ ServiceEvent()

virtual tResult ServiceEvent ( int  nEventId,
uint32_t  ui32Param1 = 0,
uint32_t  ui32Param2 = 0,
void *  pvData = nullptr,
int  szData = 0 
)
pure virtual

Signal service event.

The ServiceEvent method is called by the runtime to to signal service events.

Parameters
nEventId[in] Event identifier as defined by the tServiceEvent enumeration
ui32Param1[in] Event specific parameter.
ui32Param2[in] Event specific parameter.
pvData[in] Pointer to event specific data.
szData[in] Size of event specific data.
Returns
Standard result code, it depend on the service which return value is given. An error code will result in a runtime stop.