5#include "../global.hpp"
7#include "integer_base_node.hpp"
8#include "value_node.hpp"
11#include "_detail/iconfigurable_command_node.hpp"
12#include "_detail/ihas_value_config.hpp"
26 ,
public Private::IConfigurableCommandNode
27 ,
public Private::IHasValueConfig<IntegerBaseNodePtr>
46 return std::make_shared<CommandNode>(HandleGuard<Node>(
47 CreateGSCommandNodeTyped(okName.data(),
static_cast<CExports::TGSNamespace
>(nameSpace))));
71 auto value = GetTerminalRegisterNode<CommandNode, IntegerBaseNodePtr>(
72 this, [](
Node *node) {
return dynamic_cast<GenApi::Private::IRegisterNode *
>(node) ?
true :
false; });
76 return value->AccessMode();
85 auto value = GetTerminalRegisterNode<CommandNode, IntegerBaseNodePtr>(
86 this, [](
Node *node) {
return dynamic_cast<GenApi::Private::IRegisterNode *
>(node) ?
true :
false; });
90 return value->CacheMode();
98 [[noreturn]]
void SetIsStreamable(
const CExports::cvbint64_t & )
override
108 return (NativeCall<CExports::cvbbool_t>(
109 [&](CExports::cvbbool_t &value) {
return CVB_CALL_CAPI(GSNGetAsBoolean(
Handle(), value)); }))
119 NativeCall([&]() {
return CVB_CALL_CAPI(GSNSetAsBoolean(
Handle(),
true)); });
150 SetInfoAsInt(
NodeInfo::PollingTime, std::chrono::duration_cast<std::chrono::milliseconds>(timespan).count());
164 throw std::runtime_error(
"requested command config type must be derived from IntegerBaseNode or "
185 "IntegerBaseNode or "
186 "of type std::int64_t");
202 throw std::runtime_error(
"requested value config type must be derived from IntegerBaseNode or be "
222 "IntegerBaseNode or be of integral type");
235 std::transform(str.begin(), str.end(), str.begin(), [](
char ch)
237 return static_cast<char>(std::tolower(ch));
241 is >> std::boolalpha >> b;
253template <>
inline std::int64_t CommandNode::CommandConfig<std::int64_t>()
const
258template <>
inline IntegerBaseNodePtr CommandNode::CommandConfig<IntegerBaseNodePtr>()
const
263template <>
inline void CommandNode::SetCommandConfig<std::int64_t>(
const std::int64_t &value)
268template <>
inline std::int64_t CommandNode::ValueConfig<std::int64_t>()
const
273template <>
inline void CommandNode::SetValueConfig<std::int64_t>(
const std::int64_t &value)
A node that can be executed.
Definition: command_node.hpp:29
void Execute()
Executes this command.
Definition: command_node.hpp:117
static CommandNodePtr Create(const String &name, const GevServer::Namespace &nameSpace)
Creates a new CommandNode with the given name and nameSpace .
Definition: command_node.hpp:43
bool IsStreamable() const override
Commands are never streamable.
Definition: command_node.hpp:96
void SetPollingTime(const std::chrono::duration< Rep, Period > ×pan)
Sets the polling time of this value.
Definition: command_node.hpp:145
static CommandNodePtr Create(const String &name)
Creates a new CommandNode with the given name .
Definition: command_node.hpp:63
void SetValueConfig(const T &)
Sets the value configuration of this command node.
Definition: command_node.hpp:219
T CommandConfig() const
Gets and sets the command value configuration of this command node.
Definition: command_node.hpp:162
bool IsDone() const
If this command is readable, the execution state can be queried.
Definition: command_node.hpp:106
void FromString(const String &value) override
Executes if value is "true".
Definition: command_node.hpp:229
GenApi::CacheMode CacheMode() const override
Gets the cache mode by querying all ValueConfigs for it.
Definition: command_node.hpp:83
T ValueConfig() const
Gets and sets the value configuration of this command node.
Definition: command_node.hpp:200
GenApi::AccessMode AccessMode() const override
Gets the access mode by querying all ValueConfigs for it.
Definition: command_node.hpp:69
void SetCommandConfig(const T &)
Sets the command value configuration of this command node.
Definition: command_node.hpp:181
String ToString() const override
Gets the IsDone status as a string.
Definition: command_node.hpp:250
std::chrono::duration< Rep, Period > PollingTime() const
Gets the polling time of this value.
Definition: command_node.hpp:129
Basic GevServer node for device feature access.
Definition: decl_node.hpp:41
static GevServer::Namespace ParseNamespace(const String &name)
Gets the Namespace from the given name .
Definition: decl_node.hpp:585
static String EnsureNodeNameOnly(const String &name)
Throws if the given name has a namespace prefix.
Definition: decl_node.hpp:558
static String ParseName(const String &name)
Gets the name part of the given node name .
Definition: decl_node.hpp:607
void * Handle() const noexcept
Classic API node handle.
Definition: decl_node.hpp:101
Base class for all nodes that have a value.
Definition: value_node.hpp:32
CacheMode
Defines how the value is cached.
Definition: genapi.hpp:220
@ NoCache
No caching used.
AccessMode
Access possibility of the node.
Definition: genapi.hpp:185
@ ReadWrite
Node can be read and written to.
Namespace
The possible name spaces a node can be in.
Definition: gevserver.hpp:148
std::shared_ptr< IntegerBaseNode > IntegerBaseNodePtr
Convenience shared pointer for IntegerBaseNode.
Definition: gevserver.hpp:65
@ PollingTime
Gets the polling time in ms.
@ Value
Accesses the value configuration.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24