Skip to content

Commit 32b3ed1

Browse files
committed
fixed some documentation
1 parent c2e0591 commit 32b3ed1

File tree

5 files changed

+57
-21
lines changed

5 files changed

+57
-21
lines changed

plugins/bitorder_propagation/include/bitorder_propagation/plugin_bitorder_propagation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace hal
3939

4040
/**
4141
* @class BitorderPropagationPlugin
42-
* @brief Plugin interface for bit order propoagation.
42+
* @brief Plugin interface for the BitorderPropagationPlugin.
4343
*
4444
* This class provides an interface to integrate the bit-order propagation as a plugin within the HAL framework.
4545
*/

plugins/dot_viewer/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if(PL_DOT_VIEWER OR BUILD_ALL_PLUGINS)
2222
HEADER ${DOT_VIEWER_INC}
2323
SOURCES ${DOT_VIEWER_SRC} ${DOT_VIEWER_PYTHON_SRC} ${MOC_HDR}
2424
COMPILE_OPTIONS "-march=native"
25+
PYDOC SPHINX_DOC_INDEX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/documentation/dot_viewer.rst
2526
)
2627

2728
target_sources(dot_viewer
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DOT Viewer
2+
==========================
3+
4+
.. automodule:: dot_viewer
5+
:members: load_dot_file
6+
7+
.. autoclass:: dot_viewer.DotViewerPlugin
8+
:members:

plugins/dot_viewer/include/dot_viewer/plugin_dot_viewer.h

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved.
44
// Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved.
55
// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved.
6-
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS").
7-
// All Rights reserved.
6+
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved.
87
//
98
// Permission is hereby granted, free of charge, to any person obtaining a copy
109
// of this software and associated documentation files (the "Software"), to deal
@@ -33,35 +32,64 @@
3332

3433
namespace hal
3534
{
35+
/* forward declaration */
3636
class Netlist;
3737
class DotViewer;
3838
class DotViewerSerializer;
39-
}
4039

41-
namespace hal
42-
{
43-
extern Netlist *gNetlist;
40+
extern Netlist* gNetlist;
4441

42+
/**
43+
* @class DotViewerPlugin
44+
* @brief Plugin interface for the DotViewerPlugin.
45+
*
46+
* This class provides an interface to integrate a .dot viewer as a plugin within the HAL framework.
47+
*/
4548
class PLUGIN_API DotViewerPlugin : public BasePluginInterface
4649
{
47-
public:
50+
public:
51+
/**
52+
* @brief Default constructor for `DotViewerPlugin`.
53+
*/
4854
DotViewerPlugin();
4955

56+
/**
57+
* @brief Default destructor for `DotViewerPlugin`.
58+
*/
5059
~DotViewerPlugin() = default;
5160

61+
/**
62+
* @brief Get the name of the plugin.
63+
*
64+
* @returns The name of the plugin.
65+
*/
5266
std::string get_name() const override;
5367

68+
/**
69+
* @brief Get the version of the plugin.
70+
*
71+
* @returns The version of the plugin.
72+
*/
5473
std::string get_version() const override;
5574

75+
/**
76+
* @brief Get a short description of the plugin.
77+
*
78+
* @returns The short description of the plugin.
79+
*/
5680
std::string get_description() const override;
5781

82+
/**
83+
* @brief Get the plugin dependencies.
84+
*
85+
* @returns A set of plugin names that this plugin depends on.
86+
*/
5887
std::set<std::string> get_dependencies() const override;
5988

6089
void initialize() override;
6190

6291
void on_load() override;
6392

6493
void on_unload() override;
65-
6694
};
67-
} // namespace hal
95+
} // namespace hal

plugins/dot_viewer/python/python_bindings.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "hal_core/python_bindings/python_bindings.h"
22

3+
#include "dot_viewer/dot_viewer.h"
4+
#include "dot_viewer/plugin_dot_viewer.h"
35
#include "pybind11/operators.h"
46
#include "pybind11/pybind11.h"
57
#include "pybind11/stl.h"
68
#include "pybind11/stl_bind.h"
7-
#include "dot_viewer/plugin_dot_viewer.h"
8-
#include "dot_viewer/dot_viewer.h"
99

1010
namespace py = pybind11;
1111

@@ -18,15 +18,15 @@ namespace hal
1818
#ifdef PYBIND11_MODULE
1919
PYBIND11_MODULE(dot_viewer, m)
2020
{
21-
m.doc() = "Provides access to graphviz dot viewer plugin.";
21+
m.doc() = "Plugin to visualize .dot graphs within the HAL GUI.";
2222
#else
2323
PYBIND11_PLUGIN(dot_viewer)
2424
{
25-
py::module m("dot_viewer", "Provides access to graphviz dot viewer plugin.");
25+
py::module m("dot_viewer", "Plugin to visualize .dot graphs within the HAL GUI.");
2626
#endif // ifdef PYBIND11_MODULE
2727

2828
py::class_<DotViewerPlugin, RawPtrWrapper<DotViewerPlugin>, BasePluginInterface> py_dotviewer_plugin(
29-
m, "DotViewerPlugin", R"(This class provides a dot viewer as a plugin within the HAL framework.)");
29+
m, "DotViewerPlugin", R"(This class provides an interface to integrate a .dot viewer as a plugin within the HAL framework.)");
3030

3131
py_dotviewer_plugin.def_property_readonly("name", &DotViewerPlugin::get_name, R"(
3232
The name of the plugin.
@@ -82,22 +82,21 @@ namespace hal
8282

8383
m.def(
8484
"load_dot_file",
85-
[](const std::string& filename,
86-
const std::string& creator_plugin = "") {
85+
[](const std::string& filename, const std::string& creator_plugin = "") {
8786
QString qfilename = QString::fromStdString(filename);
88-
QString qcreator = QString::fromStdString(creator_plugin);
89-
DotViewer* dv = DotViewer::getDotviewerInstance();
87+
QString qcreator = QString::fromStdString(creator_plugin);
88+
DotViewer* dv = DotViewer::getDotviewerInstance();
9089
if (dv)
9190
{
92-
dv->handleOpenInputFileByName(qfilename,qcreator);
91+
dv->handleOpenInputFileByName(qfilename, qcreator);
9392
}
9493
else
9594
{
9695
log_error("python_context", "Cannot find dot viewer instance.");
9796
}
9897
},
9998
py::arg("filename"),
100-
py::arg("creator_plugin") = std::string(),
99+
py::arg("creator_plugin") = std::string(),
101100
R"(
102101
Loads a dot file in the graphic viewer provided by dot_viewer plugin.
103102

0 commit comments

Comments
 (0)