CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
IService.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
5
namespace
cdc::core
{
6
10
enum class
ServiceState
: uint8_t {
11
UNINITIALIZED
,
// Not yet initialized
12
INITIALIZED
,
// init() called successfully
13
STARTED
,
// start() called successfully
14
STOPPED
,
// stop() called
15
ERROR
// Error state
16
};
17
27
class
IService
{
28
public
:
29
virtual
~IService
() =
default
;
30
35
virtual
bool
init
() = 0;
36
41
virtual
bool
start
() = 0;
42
46
virtual
void
stop
() = 0;
47
51
virtual
ServiceState
getState
()
const
= 0;
52
56
virtual
const
char
*
getName
()
const
= 0;
57
};
58
59
}
// namespace cdc::core
cdc::core::IService
Definition
IService.h:27
cdc::core::IService::getState
virtual ServiceState getState() const =0
cdc::core::IService::getName
virtual const char * getName() const =0
cdc::core::IService::stop
virtual void stop()=0
cdc::core::IService::~IService
virtual ~IService()=default
cdc::core::IService::start
virtual bool start()=0
cdc::core::IService::init
virtual bool init()=0
cdc::core
Definition
AttestationKeyService.h:7
cdc::core::ServiceState
ServiceState
Definition
IService.h:10
cdc::core::ServiceState::STOPPED
@ STOPPED
Definition
IService.h:14
cdc::core::ServiceState::STARTED
@ STARTED
Definition
IService.h:13
cdc::core::ServiceState::ERROR
@ ERROR
Definition
IService.h:15
cdc::core::ServiceState::UNINITIALIZED
@ UNINITIALIZED
Definition
IService.h:11
cdc::core::ServiceState::INITIALIZED
@ INITIALIZED
Definition
IService.h:12
components
cdc_core
include
cdc_core
IService.h
Generated by
1.16.1