-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoxygen-documentation.html
executable file
·427 lines (378 loc) · 15.3 KB
/
doxygen-documentation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
<!DOCTYPE html>
<html lang="en">
<head>
<base href=".">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Doxygen documentation</title>
<link rel="stylesheet" href="assets/css/dark-frontend.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/light-frontend.css" type="text/css" title="light">
<link rel="stylesheet" href="assets/css/bootstrap-toc.min.css" type="text/css">
<link rel="stylesheet" href="assets/css/jquery.mCustomScrollbar.min.css">
<link rel="stylesheet" href="assets/js/search/enable_search.css" type="text/css">
<link rel="stylesheet" href="assets/css/extra_frontend.css" type="text/css">
<link rel="stylesheet" href="assets/css/prism-tomorrow.css" type="text/css" title="dark">
<link rel="alternate stylesheet" href="assets/css/prism.css" type="text/css" title="light">
<script src="assets/js/mustache.min.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="assets/js/scrollspy.js"></script>
<script src="assets/js/typeahead.jquery.min.js"></script>
<script src="assets/js/search.js"></script>
<script src="assets/js/compare-versions.js"></script>
<script src="assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="assets/js/bootstrap-toc.min.js"></script>
<script src="assets/js/jquery.touchSwipe.min.js"></script>
<script src="assets/js/anchor.min.js"></script>
<script src="assets/js/tag_filtering.js"></script>
<script src="assets/js/language_switching.js"></script>
<script src="assets/js/styleswitcher.js"></script>
<script src="assets/js/lines_around_headings.js"></script>
<script src="assets/js/prism-core.js"></script>
<script src="assets/js/prism-autoloader.js"></script>
<script src="assets/js/prism_autoloader_path_override.js"></script>
<script src="assets/js/trie.js"></script>
<link rel="icon" type="image/png" href="assets/images/nnstreamer_logo.png">
</head>
<body class="no-script
">
<script>
$('body').removeClass('no-script');
</script>
<nav class="navbar navbar-fixed-top navbar-default" id="topnav">
<div class="container-fluid">
<div class="navbar-right">
<a id="toc-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-wrapper" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span title="light mode switch" class="glyphicon glyphicon-sunglasses pull-right" id="lightmode-icon"></span>
<form class="navbar-form pull-right" id="navbar-search-form">
<div class="form-group has-feedback">
<input type="text" class="form-control input-sm" name="search" id="sidenav-lookup-field" placeholder="search" disabled>
<span class="glyphicon glyphicon-search form-control-feedback" id="search-mgn-glass"></span>
</div>
</form>
</div>
<div class="navbar-header">
<a id="sidenav-toggle">
<span class="glyphicon glyphicon-menu-right"></span>
<span class="glyphicon glyphicon-menu-left"></span>
</a>
<a id="home-link" href="index.html" class="hotdoc-navbar-brand">
<img src="assets/images/nnstreamer_logo.png" alt="Home">
</a>
</div>
<div class="navbar-collapse collapse" id="navbar-wrapper">
<ul class="nav navbar-nav" id="menu">
<li class="dropdown">
<a class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
API References<span class="caret"></span>
</a>
<ul class="dropdown-menu" id="modules-menu">
<li>
<a href="doc-index.html">NNStreamer doc</a>
</li>
<li>
<a href="gst/nnstreamer/README.html">NNStreamer Elements</a>
</li>
<li>
<a href="nnstreamer-example/index.html">NNStreamer Examples</a>
</li>
<li>
<a href="API-reference.html">API reference</a>
</li>
</ul>
</li>
<li>
<a href="doc-index.html">Documents</a>
</li>
<li>
<a href="gst/nnstreamer/README.html">Elements</a>
</li>
<li>
<a href="tutorials.html">Tutorials</a>
</li>
<li>
<a href="API-reference.html">API reference</a>
</li>
</ul>
<div class="hidden-xs hidden-sm navbar-text navbar-center">
</div>
</div>
</div>
</nav>
<main>
<div data-extension="core" data-hotdoc-in-toplevel="True" data-hotdoc-project="NNStreamer" data-hotdoc-ref="doxygen-documentation.html" class="page_container" id="page-wrapper">
<script src="assets/js/utils.js"></script>
<div class="panel panel-collapse oc-collapsed" id="sidenav" data-hotdoc-role="navigation">
<script src="assets/js/full-width.js"></script>
<div id="sitenav-wrapper">
<iframe src="hotdoc-sitemap.html" id="sitenav-frame"></iframe>
</div>
</div>
<div id="body">
<div id="main">
<div id="page-description" data-hotdoc-role="main">
<h1 id="doxygen-generate-documentation-from-source-code">Doxygen: Generate documentation from source code</h1>
<p>Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D.</p>
<h1 id="install-doxygen-graphviz">Install doxygen & graphviz</h1>
<ul>
<li>If you want to run <a href="http://www.doxygen.nl/">Doxygen</a> to
produce documentation from your code comments, then in addition do the following:
<ul>
<li>Install <a href="http://www.doxygen.nl/">Doxygen</a> using the
instructions on its web site. For reference, the LLVM web site is using Doxygen 1.7.6.1,
however the 1.8 series added support for Markdown formatting. We would like
to use Markdown in our comments ASAP, so use the latest version of Doxygen.
<pre><code>$ sudo apt-get install doxygen
</code></pre>
</li>
<li>Install <a href="http://graphviz.org/">Graphviz</a> using instructions on their
site. The current version no longer modifies your path, so you should
manually modify your path so that it includes "dot".
<pre><code>$ sudo apt-get install graphviz
</code></pre>
</li>
</ul>
</li>
</ul>
<h1 id="how-to-generate-documentation-from-source-code">How to generate documentation from source code</h1>
<ul>
<li>
<p>If you want to automatically generate documentation from source code in Linux by using doxygen, proceed as follows:</p>
<pre><code># for src app
$ cd ./gst
$ doxygen ../Doxyfile.prj # from https://github.com/nnstreamer/TAOS-CI/blob/main/ci/Doxyfile.prj
# launch with the browser to view the results
$ chromium-browser ./html/index.html
</code></pre>
</li>
</ul>
<h1 id="how-to-comment">How to comment</h1>
<h3 id="comments-for-files">Comments for Files</h3>
<p>Each file needs to begin with the <code>@file</code> command stating the name of the file. This should be followed by a brief description of the file using the <code>@brief</code> command. If necessary, you can follow this with a more detailed description. Next you should put your name and andrew id, along with your partners name and andrew id, using the <code>@author</code> tag. This needs to be followed with a bugs section with a list of known bugs using the <code>@bug</code> command. If there are no known bugs, explicitly state that using the <code>@bug</code> command.</p>
<h3 id="comments-for-functions-and-data-structures">Comments for Functions and Data Structures</h3>
<p>Before each function, data structure, and macro you should put a comment block giving at least a brief description using the <code>@brief</code> command. A brief description will suffice for your data structures but for your macros and functions you will need to use a few more commands. After your description, you should use the <code>@param</code> command to describe all of the parameters to your function. These descriptions should be followed by a description of the return value using the <code>@return</code> command.</p>
<p>Note: When we say "each" function, that is not a strong statement. You can leave out simple helper functions, like a max() macro, so you do not waste time.</p>
<h1 id="case-study">Case study</h1>
<h3 id="case-study-cc">Case study: C/C++</h3>
<ul>
<li>http://www.doxygen.nl/manual/docblocks.html#cppblock</li>
</ul>
<p>You have to use comments starting with ** and then the special command.</p>
<ul>
<li>C/C++ file doxygen entries:</li>
</ul>
<pre><code class="language-bash">
/**
* @file taos_struct.c
* @author Gildong Hong <[email protected]>
* @date 1/18/2018
* @brief A taos driver.
*
* These empty function definitions are provided
* so that stdio will build without complaining.
* You will need to fill these functions in. This
* is the implementation of the TAOS device driver.
* Important details about its implementation
* should go in these comments.
*
* @bug No know bugs.
* @todo Make it do something.
*/
int main(void){
taos_base_initialize();
taos_frame_run();
return 0;
}
</code></pre>
<ul>
<li>C/C++ function doxygen entries:</li>
</ul>
<pre><code class="language-bash">/**
* @brief Initialize ring buffer
* @param RingBuff : Pointer to ring buffer to initialize
* @param buffer : Pointer to buffer to associate with RingBuff
* @param itemSize : Size of each buffer item size
* @param count : Size of ring buffer
* @note Memory pointed by a buffer must have correct alignment of
* a itemSize, and a count must be a power of 2 and must at
* least be 2 or greater.
* @return Nothing
*/
int RingBuffer_Init(RINGBUFF_T *RingBuff, void *buffer, int itemSize, int count);
</code></pre>
<ul>
<li>C/C++ struct/class doxygen entries:</li>
</ul>
<pre><code class="language-bash">/**
* @def RB_VHEAD(rb)
* volatile typecasted head index
*/
#define RB_VHEAD(rb) (*(volatile uint32_t *) &(rb)->head)
/**
* @brief ring buffer structure
*/
typedef struct {
void *memBuf; /**<A void * pointing to memory of size bufSize.*/
size_t filePos; /**<Current position inside the file.*/
size_t bufPos; /**<Current position inside the buffer.*/
size_t bufSize; /**<The size of the buffer.*/
size_t bufLen; /**<The actual size of the buffer used.*/
enum bigWigFile_type_enum type; /**<The connection type*/
int isCompressed; /**<1 if the file is compressed, otherwise 0*/
char *fname; /**<Only needed for remote connections. The original URL/filename requested.*/
} ring_buffer_t;
/**
* @brief ring cache structure
*/
class ring_cache
{
public:
/**
* An enum type.
* The documentation block cannot be put after the enum!
*/
enum EnumType
{
int EVal1, /**< enum value 1 */
int EVal2 /**< enum value 2 */
};
/**
* a member function.
*/
void member();
protected:
int value; /**< an integer value */
};
</code></pre>
<h3 id="case-study-python">Case study: Python</h3>
<ul>
<li>http://www.doxygen.nl/manual/docblocks.html#pythonblocks</li>
</ul>
<p>You have to use comments starting with ## and then the special command.</p>
<pre><code class="language-bash">$ vi ./taos.py
## @package taos
# @brief A taos driver.
#
# These empty function definitions are provided
# so that stdio will build without complaining.
# You will need to fill these functions in. This
# is the implementation of the TAOS device driver.
# Important details about its implementation
# should go in these comments.
#
# @date 1 Dec 2017
# @param [in] repeat number of times to do nothing
# @retval TRUE Successfully did nothing.
# @retval FALSE Oops, did something.
# @bug No know bugs.
# @todo Make it do something.
#
# Example Usage:
# @code
# example_core(3); // Do nothing 3 times.
# @endcode
#
## @brief The constructor.
# @param self The object pointer.
def __init__(self):
self.__value = 0
## @brief Stores a value.
# @param value The value to be stored.
def setValue(self, value):
self.__value = value
## @brief Gets stored value.
# @return The stored value.
def getValue(self):
return self.__value
</code></pre>
<h3 id="case-study-bash">Case study: bash</h3>
<p>You have to use comments starting with ## and then the special command.
Then, add @file and @brief tag to the top of each script file as follows.</p>
<pre><code class="language-bash">$ vi pr-worker.sh
## @file pr-worker.sh
# @brief function for Continuous Integration (CI)
function work_core(){
. . . . . .
}
function work_gen(){
. . . . . .
}
work_core
work_gen
</code></pre>
<p>Please, refer to http://www.doxygen.nl/manual/commands.html for more details.</p>
<h1 id="how-to-generate-the-index-page-in-html">How to generate the index page in HTML</h1>
<p>If the Doxygen tag @mainpage is placed in a comment block, the block is used to
customize the index page (in HTML) or the first chapter (in $@mbox{@LaTeX}$).
The title argument is optional and replaces the default title that doxygen
normally generates. If you do not want any title you can specify notitle
as the argument of @mainpage.</p>
<p>Below is a simple example of a mainpage you can create yourself.</p>
<pre><code class="language-bash">/**
* @mainpage AutoDrive
* @section intro Introduction
* - Introduction : Application repository for autonomous solution
* @section Program Program Name
* - Program Name : AutoDrive
* - Program Details : This includes a number of internal modules which
* are sensing & perception, planning & control, global map generation, logging & HMI.
* This repository consists of TAOS-based applications as following:
* 1) creates perception information form sensor inputs,
* 2) handles map & routing information,
* 3) controls the vehicle,
* 4) and provides developers with debugging tools.
* @section INOUTPUT Input/output data
* - INPUT : None
* - OUTPUT : None
* @section CREATEINFO Code information
* - Initial date : 2017/06/14
* - Version : 0.1
*/
</code></pre>
<h1 id="how-to-generate-script-code">How to generate script code</h1>
<p>Refer to https://github.com/Anvil/bash-doxygen
Doxygen does not support bash script files by default.
Edit below lines in a Doxyfile.ci to generate *.sh files.</p>
<pre><code class="language-bash">$ vi ./Doxyfile.ci
# Set your shell script file names pattern as Doxygen inputs
FILE_PATTERNS = *.sh *.php *.taos
ITAOST_FILTER = "sed -e 's|##|//!|'"
FILTER_SOURCE_FILES = YES
# Edit the Doxyfile to map shell files to C parser
EXTENSION_MAPPING = sh=C
</code></pre>
<h1 id="references">References</h1>
<ul>
<li>Getting started: http://www.doxygen.nl/manual/starting.html</li>
<li>Case study (Linux kernel): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/sched/core.c?h=v4.13-rc1#n4454</li>
</ul>
</div>
</div>
<div id="search_results">
<p>The results of the search are</p>
</div>
<div id="footer">
</div>
</div>
<div id="toc-column">
<div class="edit-button">
</div>
<div id="toc-wrapper">
<nav id="toc"></nav>
</div>
</div>
</div>
</main>
<script src="assets/js/navbar_offset_scroller.js"></script>
</body>
</html>