d2c69ee7e8
Extracted the service API from TactilityKernel and put it in a new module at `Modules/service-module`
28 lines
532 B
C++
28 lines
532 B
C++
#pragma once
|
|
|
|
#include <service/instance.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace tt::service {
|
|
|
|
using State = ::ServiceState;
|
|
|
|
// Forward declaration
|
|
class ServiceContext;
|
|
|
|
class Service {
|
|
|
|
public:
|
|
|
|
Service() = default;
|
|
virtual ~Service() = default;
|
|
|
|
virtual bool onStart(ServiceContext& serviceContext) { return true; }
|
|
virtual void onStop(ServiceContext& serviceContext) {}
|
|
};
|
|
|
|
template<typename T>
|
|
void* create(const ::ServiceManifest* /*manifest*/) { return new std::shared_ptr<Service>(std::shared_ptr<T>(new T)); }
|
|
|
|
} |