DetectorGraph
2.0
|
Publish data to the graph for future evaluation. More...
Public Member Functions | |
FuturePublisher () | |
void | SetGraph (Graph *aGraph) |
void | PublishOnFutureEvaluation (const T &aData) |
Publish a new version of T to the Graph for future evaluation. More... | |
Protected Attributes | |
Graph * | mGraph |
Publish data to the graph for future evaluation.
Detectors inherit from a FuturePublisher<T> to implement the behavior of being a Publisher of T for a future/next evaluation. This differs from a normal Publisher in a very fundamental way, it enables a detector to publish something to an upstream topic - thus constructing a feedback loop. Normally, publishing to an upstream topic would create a directed cycle in the graph thus making it impossible to be topologically sorted.
Using FuturePublisher a detector can implement a feedback loop while still making sure the topological nature of graph evaluation is preserved.
A class FooDetector
acquires the "FuturePublisher of BarTopicState" behavior by inheriting FuturePublisher
templated to BarTopicState
.
This is a template class and so it must be kept minimal to prevent code bloat. This class serves a tiny purpose:
The only requirement to use the FuturePublisher functionality is to call Detector::SetupFuturePublishing from the inheriting Detector's constructor:
Below is an example:
When implementing feedback loops in a graph one should also consider DetectorGraph::Lag as in some cases it's more general and extensible.
Definition at line 61 of file futurepublisher.hpp.
|
inline |
Definition at line 65 of file futurepublisher.hpp.
|
inline |
Publish a new version of T to the Graph for future evaluation.
Definition at line 77 of file futurepublisher.hpp.
|
inline |
Definition at line 69 of file futurepublisher.hpp.
|
protected |
Definition at line 84 of file futurepublisher.hpp.