Expanded comments to made endpoint and persistance easier to understand
This commit is contained in:
@@ -15,8 +15,9 @@
|
|||||||
template <class T>
|
template <class T>
|
||||||
class FSPersistencePB {
|
class FSPersistencePB {
|
||||||
public:
|
public:
|
||||||
|
// Formats are passed as referenced const (local variable) we want to read from, and a reference (proto) we write to
|
||||||
using ProtoStateReader = std::function<void(const T&, T&)>;
|
using ProtoStateReader = std::function<void(const T&, T&)>;
|
||||||
// Formats are passed as referenced const (new object), and a reference to local variable we either want to read from or write to
|
// Formats are passed as referenced const (new object) we read from, and a reference to the local variable we write to
|
||||||
using ProtoStateUpdater = std::function<StateUpdateResult(const T&, T&)>;
|
using ProtoStateUpdater = std::function<StateUpdateResult(const T&, T&)>;
|
||||||
|
|
||||||
FSPersistencePB(ProtoStateReader stateReader, ProtoStateUpdater stateUpdater,
|
FSPersistencePB(ProtoStateReader stateReader, ProtoStateUpdater stateUpdater,
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ template <class T, class ProtoT>
|
|||||||
class StatefulProtoEndpoint {
|
class StatefulProtoEndpoint {
|
||||||
public:
|
public:
|
||||||
/** Converts internal state to protobuf message for responses */
|
/** Converts internal state to protobuf message for responses */
|
||||||
|
// Formats are passed as referenced const (local variable) we want to read from, and a reference (proto) we write to
|
||||||
using ProtoStateReader = std::function<void(const T&, ProtoT&)>;
|
using ProtoStateReader = std::function<void(const T&, ProtoT&)>;
|
||||||
/** Converts incoming protobuf message to internal state */
|
/** Converts incoming protobuf message to internal state */
|
||||||
|
// Formats are passed as referenced const (new object) we read from, and a reference to the local variable we write to
|
||||||
using ProtoStateUpdater = std::function<StateUpdateResult(const ProtoT&, T&)>;
|
using ProtoStateUpdater = std::function<StateUpdateResult(const ProtoT&, T&)>;
|
||||||
/** Extracts the specific proto type from Request oneof */
|
/** Extracts the specific proto type from Request oneof */
|
||||||
using RequestExtractor = std::function<bool(const api_Request&, ProtoT&)>;
|
using RequestExtractor = std::function<bool(const api_Request&, ProtoT&)>;
|
||||||
|
|||||||
Reference in New Issue
Block a user