🫏 Adds getter for state
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <PsychicHttp.h>
|
||||
#include <template/stateful_endpoint.h>
|
||||
#include <template/stateful_service.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
||||
@@ -160,14 +160,14 @@ class StatefulService {
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
T &state() { return _state; }
|
||||
|
||||
private:
|
||||
T _state;
|
||||
|
||||
inline void beginTransaction() { xSemaphoreTakeRecursive(_accessMutex, portMAX_DELAY); }
|
||||
|
||||
inline void endTransaction() { xSemaphoreGiveRecursive(_accessMutex); }
|
||||
|
||||
private:
|
||||
SemaphoreHandle_t _accessMutex;
|
||||
std::list<StateUpdateHandlerInfo_t> _updateHandlers;
|
||||
std::list<StateHookHandlerInfo_t> _hookHandlers;
|
||||
|
||||
Reference in New Issue
Block a user