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

Commit c8c8025

Browse files
committed
Using snippetlineno instead of snippet to make it clear that those are code snippets for that example.
1 parent dd26490 commit c8c8025

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

examples/counterwithreset.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ digraph GraphAnalyzer {
7575
* `Reset` TopicState should be evaluated in the next Evaluation pass and not
7676
* in the current one. In such cases it is reasonable to put the responsibility
7777
* for closing the loop on the writer of `ResetDetector`:
78-
* @snippet counterwithreset.cpp Reset Detector
78+
* @snippetlineno counterwithreset.cpp Reset Detector
7979
*
8080
* In cases where downstream parts of the graph also subscribe to the
8181
* TopicState used in the feedback loop, DetectorGraph::Lag should be used
@@ -84,9 +84,9 @@ digraph GraphAnalyzer {
8484
*
8585
* @section Graph
8686
* The graph instantiated and evaluation code is unaffected. Both
87-
@snippet counterwithreset.cpp CounterWithResetGraph
87+
@snippetlineno counterwithreset.cpp CounterWithResetGraph
8888
* and
89-
@snippet counterwithreset.cpp main
89+
@snippetlineno counterwithreset.cpp main
9090
* work in the same way as with simple graphs.
9191
*
9292
* Running the program produces:

examples/helloworld.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,26 @@ using std::endl;
4545
* DetectorGraph::TopicState.
4646
*
4747
* For the 'input' to our system we'll declare a `TemperatureSample` TopicState:
48-
@snippet helloworld.cpp Input Topic
48+
@snippetlineno helloworld.cpp Input Topic
4949
* The important here is that this `struct` inherits TopicState and that it has
5050
* data field(s).
5151
*
5252
* Next we define the 'output'; another struct that also inherits
5353
* DetectorGraph::TopicState and has data fields:
54-
@snippet helloworld.cpp Output Topic
54+
@snippetlineno helloworld.cpp Output Topic
5555
*
5656
* @section Detector
5757
* Now we just need to fill in the gap; the Detector that creates
5858
* `OverheatingState` from `TemperatureSample`:
5959
* two.
60-
@snippet helloworld.cpp Detector
60+
@snippetlineno helloworld.cpp Detector
6161
*
6262
* @section 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
6666
* simplest:
67-
@snippet helloworld.cpp Adding to a Graph
67+
@snippetlineno helloworld.cpp Adding to a Graph
6868
*
6969
* With that the Graph instance will internally create the following graph:
7070
*
@@ -90,7 +90,7 @@ digraph GraphAnalyzer {
9090
* @section Usage
9191
* Finally, using the graph is done by Pushing data in, evaluating the graph
9292
* and checking outputs:
93-
@snippet helloworld.cpp Basic Graph Usage
93+
@snippetlineno helloworld.cpp Basic Graph Usage
9494
*
9595
* Running the program then gives:
9696
\verbatim
@@ -104,10 +104,10 @@ IsOverheating = true
104104
* subsequent inspection steps.
105105
* For the example above, the DetectorGraph::ProcessorContainer implementation
106106
* would be:
107-
@snippet helloworld.cpp ProcessorContainer
107+
@snippetlineno helloworld.cpp ProcessorContainer
108108
*
109109
* And then usage would be like:
110-
@snippet helloworld.cpp Using ProcessorContainer
110+
@snippetlineno helloworld.cpp Using ProcessorContainer
111111
*
112112
*
113113
\verbatim

examples/portuguesetranslator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ using std::endl;
5252
*
5353
* In this example, the `TranslationDictionary` TopicState carries a large,
5454
* immutable object and does so using a shared_ptr<const T>:
55-
@snippet portuguesetranslator.cpp Immutable Shared Memory TopicState
55+
@snippetlineno portuguesetranslator.cpp Immutable Shared Memory TopicState
5656
*
5757
* A different example that also uses this pattern is
5858
* [Fancy Vending Machine](@ref fancyvendingmachine.cpp):
59-
@snippet fancyvendingmachine.cpp Immutable Shared Memory TopicState
59+
@snippetlineno fancyvendingmachine.cpp Immutable Shared Memory TopicState
6060
*
6161
* @section Architecture
6262
* This sample implements the following graph:

examples/robotlocalization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ using namespace Eigen;
4545
* This localization algorithm depends on a feedback-loop in that the output of
4646
* one graph evaluation (i.e. `LocalizationBelief`) is used as an input for the
4747
* next one (i.e. `Lagged<LocalizationBelief>`):
48-
@snippet robotlocalization.cpp KalmanPoseCorrector Feedback Loop
48+
@snippetlineno robotlocalization.cpp KalmanPoseCorrector Feedback Loop
4949
* Note that in this graph the TopicState where the feedback loop closes is a
5050
* legitimate output in itself and it's very likely that new Detectors in the
5151
* graph would subscribe to it. In cases like this the use of

examples/trivialvendingmachine.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using std::endl;
3737
*
3838
* @section tts Trivial TopicStates
3939
* A _Trivial TopicState_ has no data fields:
40-
@snippet trivialvendingmachine.cpp Trivial TopicState
40+
@snippetlineno trivialvendingmachine.cpp Trivial TopicState
4141
* These are sometimes useful to represent parameter-less signals, timeouts etc.
4242
*
4343
* @section nts Named TopicStates
@@ -58,20 +58,20 @@ using std::endl;
5858
* [TopicStateIdType](@ref DetectorGraph::TopicStateIdType) and be different than
5959
* [TopicState::kAnonymousTopicState](@ref DetectorGraph::TopicState::kAnonymousTopicState)
6060
* (-1). An example would be:
61-
@snippet trivialvendingmachine.cpp Application-Specific Enum for Named TopicStates
61+
@snippetlineno trivialvendingmachine.cpp Application-Specific Enum for Named TopicStates
6262
(`C++03` enums are fine too)
6363
*
6464
* Which then can be used in the overriding of TopicState::GetId for the desired
6565
* named TopicState:
66-
@snippet trivialvendingmachine.cpp Named TopicState
66+
@snippetlineno trivialvendingmachine.cpp Named TopicState
6767
*
6868
* That then enables things like:
69-
@snippet trivialvendingmachine.cpp Inspecting Graph Output with Named TopicStates
69+
@snippetlineno trivialvendingmachine.cpp Inspecting Graph Output with Named TopicStates
7070
*
7171
* @section dga GraphAnalyzer
7272
* Finally, this example also shows how to use DetectorGraph::GraphAnalyzer to
7373
* generate a GraphViz-compatible `.dot` representation of the graph:
74-
@snippet trivialvendingmachine.cpp Using GraphAnalyzer to Create dot file
74+
@snippetlineno trivialvendingmachine.cpp Using GraphAnalyzer to Create dot file
7575
*
7676
* That .dot file when rendered generates the following graph:
7777
@dot "Trivial Vending Machine"

0 commit comments

Comments
 (0)