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

#include <service.h>

Inheritance diagram for Service:
Inheritance graph

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 ( )

Definition at line 46 of file service.h.

virtual Service::~Service ( )

Member Function Documentation

ServiceState Service::getState ( )

Return the current ServiceState if this service.


Definition at line 101 of file service.h.

virtual std::string Service::getStatusString ( )

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


Reimplemented in RunnableService.

Definition at line 92 of file service.h.

void Service::setState ( ServiceState  new_state)

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


Definition at line 111 of file service.h.

virtual bool Service::shutdown ( )

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; }


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 ( )

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; }


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_

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:

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