Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 09fc883

Browse files
authored
Quick docs update with SEO for Visualization and adding a graph image to the readme. (#8)
1 parent e7def6a commit 09fc883

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,43 @@ Applications are written as a combination of *Detectors* and *Topics*.
2323

2424
*Topics* carry a particular signal/data-type:
2525

26-
struct SensorData : public DetectorGraph::TopicState
26+
struct FooSensorData : public DetectorGraph::TopicState
2727
{
2828
int x;
2929
}
3030

3131
*Detectors* encode a logical unit that describes the transformation from any number of *Topics* to any number of other *Topics*:
3232

33-
class ThresholdDetector : public DetectorGraph::Detector,
34-
public DetectorGraph::SubscriberInterface<SensorData>,
35-
public DetectorGraph::Publisher<ThresholdCrossing>
33+
class BarThresholdDetector : public DetectorGraph::Detector,
34+
public DetectorGraph::SubscriberInterface<FooSensorData>,
35+
public DetectorGraph::Publisher<BazThresholdCrossing>
3636
{
37-
ThresholdDetector(DetectorGraph::Graph* graph) : DetectorGraph::Detector(graph)
37+
BarThresholdDetector(DetectorGraph::Graph* graph) : DetectorGraph::Detector(graph)
3838
{
39-
Subscribe<SensorData>(this);
40-
SetupPublishing<ThresholdCrossing>(this);
39+
Subscribe<FooSensorData>(this);
40+
SetupPublishing<BazThresholdCrossing>(this);
4141
}
42-
virtual void Evaluate(const SensorData& data)
42+
virtual void Evaluate(const FooSensorData& data)
4343
{
4444
if (data.x > 100)
4545
{
46-
Publish(ThresholdCrossing(data.x));
46+
Publish(BazThresholdCrossing(data.x));
4747
}
4848
}
4949
}
5050

5151
*DetectorGraphs* are created by adding any number of *Detectors* to a *Graph*. All necessary *Topics* are created on demand and supplied via Dependency Injection.
5252

5353
DetectorGraph::Graph graph;
54-
ThresholdDetector detector(&graph);
54+
BarThresholdDetector detector(&graph);
5555

5656
*Detectors* and *Topics* are kept sorted in topological order.
5757

5858
Graph *Evaluations* start after data is posted to a *Topic*. This causes all Detector's [`Evaluate()`](@ref DetectorGraph::SubscriberInterface::Evaluate) methods for that *Topic* to be called with the new piece of data which in turn may result in new data being posted to subsequent *Topics*. That may then trigger the `Evaluate()` of other *Detectors*. This process continues following the topological order until the end of the *Graph* is reached or until no more *Topics* with subscribers have new data.
5959

60+
![digraph { FooSensorData -> ThresholdDetector -> ThresholdCrossing }](https://google.github.io/detectorgraph/readme_graph.png)
61+
*Graphs can be visualized with Graphviz*
62+
6063
## User Guide
6164

6265
Below are a number of examples showcasing different aspects & usage patterns of the framework (these are in the `./examples/` folder).

doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ WARN_LOGFILE =
765765
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
766766
# Note: If this tag is empty the current directory is searched.
767767

768-
INPUT = README.md makefile ./include ./src ./test-util ./examples ./platform_standalone ./doxygen
768+
INPUT = README.md makefile ./include ./src ./util ./test-util ./examples ./platform_standalone ./doxygen
769769

770770
# This tag can be used to specify the character encoding of the source files
771771
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

doxygen/custom_examples.dox

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,15 @@ Full Example: @ref ex-rg-state-persistence
7272
/**
7373
@page seo-state-persistence State Persistence
7474
@copydoc seo-resume-state
75-
*/
75+
*/
76+
77+
/**
78+
@page seo-graphviz Graphviz Visualization
79+
Any DetectorGraph graphs can be visualized using Graphviz. For more see
80+
DetectorGraph::GraphAnalyzer and see this [visualization example](@ref ex-tvm-dga) .
81+
*/
82+
83+
/**
84+
@page seo-visualization Visualization
85+
@copydoc seo-graphviz
86+
*/

examples/helloworld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ using std::endl;
5959
* two.
6060
@snippetlineno helloworld.cpp Detector
6161
*
62-
* @section ex-hw-graphGraph
62+
* @section ex-hw-graph Graph
6363
* The final plumbing is to add our newly created Detector to a
6464
* DetectorGraph::Graph.
6565
* Depending on the situation this can be done in different ways but here's the

0 commit comments

Comments
 (0)