API Guides > ConceptRT 3.x
Service< ServiceType, Priority, StackSize > Class Template Reference

Service helper class. More...

Detailed Description

template<class ServiceType, ThreadPriority Priority = PriorityNormal, Int32 StackSize = DefaultStackSize>
class ConceptRT::Service< ServiceType, Priority, StackSize >

Service helper class.

Template Parameters
ServiceTypeThe interited class in order to identifiy the service category.
PriorityThe interited class in order to identifiy the service category. Default = PriorityNormal.
StackSizeSize of the service controller thread service stack. Default = DefaultStackSize.

Create a new catgory of service and instantiate its dedicated ServiceController.

Usage :

class MyService : public Service<MyService, PriorityNormal>
{
public:
MyService()
{
// code if needed.
RegisterServiceController(); // called once the service is completely created.
}
virtual ~MyService()
{
UnregisterServiceController(); // called as soon as the service is beeing destroyed.
// code if needed.
}
protected:
{
...
}
};
+ Inheritance diagram for Service< ServiceType, Priority, StackSize >:

Public Member Methods

 Service ()
 Constuctor. More...
 
virtual ~Service ()
 Destructor. More...
 
- Public Member Methods inherited from BaseService
 BaseService (BaseServiceController &serviceController)
 Constuctor. More...
 
void SetPeriod (TimeSpan period)
 Set the period of the service. More...
 
TimeSpan GetPeriod () const
 Gets the service period. More...
 

Additional Inherited Members

- Protected Member Functions inherited from BaseService
virtual void InitialExecute ()
 Initial execution of the service. More...
 
virtual void CyclicExecute ()=0
 Cyclic execution of the service. More...
 
virtual void FinalExecute ()
 Final execution of the service. More...
 
void UnregisterServiceController ()
 Method used by inherited class to unregister the service controller. More...
 
void RegisterServiceController ()
 Method used by inherited class to register the service controller once completely created. More...
 

Constructor & Destructor Documentation

Service ( )
inline

Constuctor.

Warning
Non-Deterministic: May instanciate the service controller on the heap. Determinism when using ConceptRT library can be ensure by using Context Time Critical mechanisms.
virtual ~Service ( )
inlinevirtual

Destructor.

Warning
Non-Deterministic: May delete the service controller from the heap. Determinism when using ConceptRT library can be ensure by using Context Time Critical mechanisms.