From 455a1b2d51cec0311ccfd00cee5870c20b22f3c3 Mon Sep 17 00:00:00 2001 From: Daniel Pelanek Date: Thu, 13 Jun 2024 14:23:34 +0200 Subject: [PATCH] added doxygen --- CMakeLists.txt | 2 +- examples/basicExample.cpp | 10 ++++- ...variantsExample.cpp => contentExample.cpp} | 12 ++++-- examples/hiolderExample.cpp | 41 +++++++++++++++++++ 4 files changed, 59 insertions(+), 6 deletions(-) rename examples/{variantsExample.cpp => contentExample.cpp} (89%) create mode 100644 examples/hiolderExample.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 43bc81e..a52ad23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ option(TELEMETRY_BUILD_SHARED "Build shared library" ON) option(TELEMETRY_PACKAGE_BUILDER "Enable RPM package builder (make rpm)" ON) option(TELEMETRY_INSTALL_TARGETS "Generate the install target" ON) option(TELEMETRY_ENABLE_TESTS "Build Unit tests (make test)" OFF) -option(TELEMETRY_BUILD_EXAMPLES "Build included example files (make example)" OFF) +option(TELEMETRY_BUILD_EXAMPLES "Build included example files (make example)" ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/examples/basicExample.cpp b/examples/basicExample.cpp index 6f9eb6e..803fcff 100644 --- a/examples/basicExample.cpp +++ b/examples/basicExample.cpp @@ -1,3 +1,11 @@ +/** + * @file + * @author Daniel Pelanek + * @brief Shows the basic usage of telemetry with fuse + * + * SPDX-License-Identifier: BSD-3-Clause + */ + #include #include #include @@ -89,6 +97,4 @@ int main() { // should print the time elapsed in seconds since the start of the program. std::signal(SIGINT, signalHandler); while(!g_gotSIGINT.load()){}; - - return 0; } diff --git a/examples/variantsExample.cpp b/examples/contentExample.cpp similarity index 89% rename from examples/variantsExample.cpp rename to examples/contentExample.cpp index 2990703..019693c 100644 --- a/examples/variantsExample.cpp +++ b/examples/contentExample.cpp @@ -1,6 +1,12 @@ +/** + * @file + * @author Daniel Pelanek + * @brief Shows how telemetry content data types are used + * + * SPDX-License-Identifier: BSD-3-Clause + */ + #include -#include -#include // example help #include @@ -48,4 +54,4 @@ int main() { std::cout << telemetry::contentToString(scalartWithUnitReturn()); std::cout << telemetry::contentToString(arrayReturn()); std::cout << telemetry::contentToString(dictReturn()); -} \ No newline at end of file +} diff --git a/examples/hiolderExample.cpp b/examples/hiolderExample.cpp new file mode 100644 index 0000000..d14c523 --- /dev/null +++ b/examples/hiolderExample.cpp @@ -0,0 +1,41 @@ +/** + * @file + * @author Daniel Pelanek + * @brief + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include + +class IOwnTelemetryFiles { + public: + void configTelemetry(const std::shared_ptr& rootDir) { + const telemetry::FileOps fileOps + = {nullptr, nullptr}; + + auto someFile = rootDir->addFile("stats", fileOps); + + + } + + private: + telemetry::Holder m_telemetryHolder; +} + +int main() { + // Same as basic example + std::shared_ptr telemetryRootNode; + telemetryRootNode = telemetry::Directory::create(); + + std::string fusePath = "fusedir"; + + telemetry::appFs::AppFsFuse fuse = telemetry::appFs::AppFsFuse(telemetryRootNode, fusePath); + fuse.start(); + + const IOwnTelemetryFiles object; + + object.configTelemetry(telemetryRootNode); +} +