15 #ifndef DETECTORGRAPH_INCLUDE_GRAPH_HPP_ 16 #define DETECTORGRAPH_INCLUDE_GRAPH_HPP_ 30 #if defined(BUILD_FEATURE_DETECTORGRAPH_CONFIG_LITE) 32 #include "detectorgraphliteconfig.hpp" 131 #if defined(BUILD_FEATURE_DETECTORGRAPH_CONFIG_LITE) 167 #if defined(BUILD_FEATURE_DETECTORGRAPH_CONFIG_LITE) 172 mTopicRegistry.
Register<TTopicState>(tObj);
187 template<
class TTopicState>
void PushData(
const TTopicState& aTopicState)
189 mGraphInputQueue.
Enqueue(*ResolveTopic<TTopicState>(), aTopicState);
240 VertexPtrContainer mVertices;
243 #if defined(BUILD_FEATURE_DETECTORGRAPH_CONFIG_LITE) 249 bool IsGraphSorted();
253 struct GraphTopicAllocatorCtxt {};
266 const std::list<ptr::shared_ptr<const TopicState> >&
GetOutputList()
const;
286 std::list<ptr::shared_ptr<const TopicState> > mOutputList;
293 #endif // DETECTORGRAPH_INCLUDE_GRAPH_HPP_
const VertexPtrContainer & GetVertices() const
TopicRegistry & GetTopicRegistry()
Implements a graph of Topics & Detectors with Input/Output APIs.
Internal - A limited-size Container for Topic<T>s
void PushData(const TTopicState &aTopicState)
Push data to a specific topic in the graph.
Manage data and its handler.
virtual ~Graph()
Destructor.
void Register(Topic< TTopicState > *obj)
ErrorType TopoSortGraph()
Determine the right order to process the vertices by topological sort.
bool EvaluateIfHasDataPending()
Evaluates Graph if data is pending and returns true if so.
Topic< TTopicState > * Resolve()
void AddVertex(Vertex *aVertex)
Topic< TTopicState > * ResolveTopic()
Find/add a topic in the detector graph.
bool HasDataPending()
Returns true if there is data pending evaluation.
const std::list< ptr::shared_ptr< const TopicState > > & GetOutputList() const
Returns the list of topicstates published in the last Evaluation.
void RemoveVertex(Vertex *aVertex)
std::list< Vertex * > VertexPtrContainer
ErrorType EvaluateGraph()
Evaluate the whole graph.
Define behaviors of a vertex in a graph.