diff --git a/include/villas/api/request.hpp b/include/villas/api/request.hpp index fa344961e..42055251f 100644 --- a/include/villas/api/request.hpp +++ b/include/villas/api/request.hpp @@ -143,6 +143,12 @@ public: { return "api:request"; } + + virtual + bool isHidden() const + { + return false; + } }; template diff --git a/include/villas/format.hpp b/include/villas/format.hpp index dbf02ff8f..099285b29 100644 --- a/include/villas/format.hpp +++ b/include/villas/format.hpp @@ -172,6 +172,12 @@ public: { return "format"; } + + virtual + bool isHidden() const + { + return false; + } }; template diff --git a/include/villas/hook.hpp b/include/villas/hook.hpp index f0280c007..9b0804c4f 100644 --- a/include/villas/hook.hpp +++ b/include/villas/hook.hpp @@ -274,6 +274,12 @@ public: { return "hook"; } + + virtual + bool isHidden() const + { + return false; + } }; template diff --git a/include/villas/node.hpp b/include/villas/node.hpp index 88f022ff5..7416ac1c6 100644 --- a/include/villas/node.hpp +++ b/include/villas/node.hpp @@ -381,7 +381,8 @@ public: SUPPORTS_WRITE = (1 << 2), REQUIRES_WEB = (1 << 3), PROVIDES_SIGNALS = (1 << 4), - INTERNAL = (1 << 5) + INTERNAL = (1 << 5), + HIDDEN = (1 << 6) }; NodeList instances; @@ -434,6 +435,12 @@ public: return getFlags() & (int) Flags::INTERNAL; } + bool + isHidden() const + { + return isInternal() || getFlags() & (int) Flags::HIDDEN; + } + virtual int start(SuperNode *sn); diff --git a/src/villas-node.cpp b/src/villas-node.cpp index 83474eb86..6375b60ac 100644 --- a/src/villas-node.cpp +++ b/src/villas-node.cpp @@ -107,27 +107,33 @@ protected: << "Supported node-types:" << std::endl; for (auto p : registry->lookup()) { - if (!p->isInternal()) + if (!p->isHidden()) std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl; } std::cout << std::endl; std::cout << "Supported IO formats:" << std::endl; - for (auto p : registry->lookup()) - std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl; + for (auto p : registry->lookup()) { + if (!p->isHidden()) + std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl; + } std::cout << std::endl; #ifdef WITH_HOOKS std::cout << "Supported hooks:" << std::endl; - for (auto p : registry->lookup()) - std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl; + for (auto p : registry->lookup()) { + if (!p->isHidden()) + std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl; + } std::cout << std::endl; #endif /* WITH_HOOKS */ #ifdef WITH_API std::cout << "Supported API commands:" << std::endl; - for (auto p : registry->lookup()) - std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl; + for (auto p : registry->lookup()) { + if (!p->isHidden()) + std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl; + } std::cout << std::endl; #endif /* WITH_API */