Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Service Class Reference

#include <service.h>

Inheritance diagram for Service:
Inheritance graph
[legend]

Public Member Functions

ServiceState getState ()
 
virtual std::string getStatusString ()
 
 Service ()
 
virtual bool shutdown ()
 
virtual bool start ()
 
virtual ~Service ()=default
 

Protected Member Functions

void setState (ServiceState new_state)
 

Private Attributes

ObservableObject< ServiceStatestate_
 

Detailed Description

Interface that defines init, start, and shutdown methods for an implementing class to define.

Definition at line 43 of file service.h.

Constructor & Destructor Documentation

Service::Service ( )
inline

Definition at line 46 of file service.h.

virtual Service::~Service ( )
virtualdefault

Member Function Documentation

ServiceState Service::getState ( )
inline

Return the current ServiceState if this service.

Returns
ServiceState

Definition at line 101 of file service.h.

virtual std::string Service::getStatusString ( )
inlinevirtual

Return a descriptive string describing the service and it's state.

Returns

Reimplemented in RunnableService.

Definition at line 92 of file service.h.

void Service::setState ( ServiceState  new_state)
inlineprotected

Set the current state of the service. To be used by overriding classes.

Parameters
new_state

Definition at line 111 of file service.h.

virtual bool Service::shutdown ( )
inlinevirtual

Cleanup. Should be called before destruction. The format overriding classes should use is the following:

virtual bool shutdown() { // immediately set the shutdown state bool b = Service::shutdown();

// do specific shutdown logic here

// return the result of Service::shutdown() or something else if desired return b; }

Returns

Reimplemented in DataBatcher< T >, DataBatcher< int >, RunnableService, Publisher< T >, Publisher< std::string >, Aws::CloudWatch::CloudWatchService< D, T >, TestBatcher, and HardWorker.

Definition at line 83 of file service.h.

virtual bool Service::start ( )
inlinevirtual

Called to start doing work. The format overriding classes should use is the following:

virtual bool start() { // do specific start logic here

// ensure the service state has been set to started bool b = Service::start();

// return the result of Service::start() or something else if desired return b; }

Returns

Reimplemented in RunnableService, Aws::CloudWatch::CloudWatchService< D, T >, and TestBatcher.

Definition at line 64 of file service.h.

Member Data Documentation

ObservableObject<ServiceState> Service::state_
private

The current state of this service.

Definition at line 119 of file service.h.


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


dataflow_lite
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:22