bab3eb19bc
- Refactor `AppManifest`: add new fields and rename existing ones - Parse and validate the manifest from an app that is being installed. - Remove deprecated `scoped()` from `Lock` - Create `Tactility/Paths.h` - App loading at boot now properly parses the manifest files of external apps - Properly lock both source and destination locations during app install - Remove LVGL path variants from `AppPaths` and `ServicePaths` - Removed `xPath` base classes for apps and services. There's now `AppPaths` and `ServicePaths`. - Renamed app and service paths: "data" and "system" paths are now "user data" and "assets"
37 lines
950 B
C++
37 lines
950 B
C++
#pragma once
|
|
|
|
#include <Tactility/service/ServiceContext.h>
|
|
#include <Tactility/service/Service.h>
|
|
#include <Tactility/Mutex.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace tt::service {
|
|
|
|
class ServiceInstance final : public ServiceContext {
|
|
|
|
Mutex mutex = Mutex(Mutex::Type::Normal);
|
|
std::shared_ptr<const ServiceManifest> manifest;
|
|
std::shared_ptr<Service> service;
|
|
State state = State::Stopped;
|
|
|
|
public:
|
|
|
|
explicit ServiceInstance(std::shared_ptr<const ServiceManifest> manifest);
|
|
~ServiceInstance() override = default;
|
|
|
|
/** @return a reference to the service's manifest */
|
|
const ServiceManifest& getManifest() const override;
|
|
|
|
/** Retrieve the paths that are relevant to this service */
|
|
std::unique_ptr<ServicePaths> getPaths() const override;
|
|
|
|
std::shared_ptr<Service> getService() const { return service; }
|
|
|
|
State getState() const { return state; }
|
|
|
|
void setState(State newState) { state = newState; }
|
|
};
|
|
|
|
}
|