1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

allow hiding of different plugin types

This commit is contained in:
Steffen Vogel 2022-03-14 15:34:10 -04:00
parent 1d7f0a562e
commit 56c966f61d
5 changed files with 39 additions and 8 deletions

View file

@ -143,6 +143,12 @@ public:
{
return "api:request";
}
virtual
bool isHidden() const
{
return false;
}
};
template<typename T, const char *name, const char *re, const char *desc>

View file

@ -172,6 +172,12 @@ public:
{
return "format";
}
virtual
bool isHidden() const
{
return false;
}
};
template <typename T, const char *name, const char *desc, int flags = 0>

View file

@ -274,6 +274,12 @@ public:
{
return "hook";
}
virtual
bool isHidden() const
{
return false;
}
};
template <typename T, const char *name, const char *desc, int flags = 0, unsigned prio = 99>

View file

@ -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);

View file

@ -107,27 +107,33 @@ protected:
<< "Supported node-types:" << std::endl;
for (auto p : registry->lookup<NodeFactory>()) {
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<FormatFactory>())
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
for (auto p : registry->lookup<FormatFactory>()) {
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<HookFactory>())
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
for (auto p : registry->lookup<HookFactory>()) {
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<api::RequestFactory>())
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
for (auto p : registry->lookup<api::RequestFactory>()) {
if (!p->isHidden())
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
}
std::cout << std::endl;
#endif /* WITH_API */