Files
tactility/Tactility/Include/Tactility/service/Service.h
T
Ken Van Hoeylandt d2c69ee7e8 Move service API from TactilityKernel to service-module (#604)
Extracted the service API from TactilityKernel and put it in a new module at `Modules/service-module`
2026-08-01 20:51:43 +02:00

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