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"
13#include "_detail/iconfigurable_register_node.hpp"
27 ,
public Private::IConfigurableCommandNode
28 ,
public Private::IHasValueConfig<IntegerBaseNodePtr>
47 return std::make_shared<CommandNode>(HandleGuard<Node>(
48 CreateGSCommandNodeTyped(okName.data(),
static_cast<CExports::TGSNamespace
>(nameSpace))));
72 auto value = GetTerminalRegisterNode<CommandNode, IntegerBaseNodePtr>(
73 this, [](
Node *node) {
return dynamic_cast<Private::IConfigurableRegisterNode*
>(node) ?
true :
false; });
77 return value->AccessMode();
86 auto value = GetTerminalRegisterNode<CommandNode, IntegerBaseNodePtr>(
87 this, [](
Node *node) {
return dynamic_cast<Private::IConfigurableRegisterNode*
>(node) ?
true :
false; });
91 return value->CacheMode();
99 [[noreturn]]
void SetIsStreamable(
const CExports::cvbint64_t & )
override
109 return (NativeCall<CExports::cvbbool_t>(
110 [&](CExports::cvbbool_t &value) {
return CVB_CALL_CAPI(GSNGetAsBoolean(
Handle(), value)); }))
120 NativeCall([&]() {
return CVB_CALL_CAPI(GSNSetAsBoolean(
Handle(),
true)); });
151 SetInfoAsInt(
NodeInfo::PollingTime, std::chrono::duration_cast<std::chrono::milliseconds>(timespan).count());
165 throw std::runtime_error(
"requested command config type must be derived from IntegerBaseNode or "
186 "IntegerBaseNode or "
187 "of type std::int64_t");
203 throw std::runtime_error(
"requested value config type must be derived from IntegerBaseNode or be "
223 "IntegerBaseNode or be of integral type");
236 std::transform(str.begin(), str.end(), str.begin(), [](
char ch)
238 return static_cast<char>(std::tolower(ch));
242 is >> std::boolalpha >> b;
254template <>
inline std::int64_t CommandNode::CommandConfig<std::int64_t>()
const
259template <>
inline IntegerBaseNodePtr CommandNode::CommandConfig<IntegerBaseNodePtr>()
const
264template <>
inline void CommandNode::SetCommandConfig<std::int64_t>(
const std::int64_t &value)
269template <>
inline std::int64_t CommandNode::ValueConfig<std::int64_t>()
const
274template <>
inline void CommandNode::SetValueConfig<std::int64_t>(
const std::int64_t &value)
A node that can be executed.
Definition: command_node.hpp:30
void Execute()
Executes this command.
Definition: command_node.hpp:118
static CommandNodePtr Create(const String &name, const GevServer::Namespace &nameSpace)
Creates a new CommandNode with the given name and nameSpace .
Definition: command_node.hpp:44
bool IsStreamable() const override
Commands are never streamable.
Definition: command_node.hpp:97
void SetPollingTime(const std::chrono::duration< Rep, Period > ×pan)
Sets the polling time of this value.
Definition: command_node.hpp:146
static CommandNodePtr Create(const String &name)
Creates a new CommandNode with the given name .
Definition: command_node.hpp:64
void SetValueConfig(const T &)
Sets the value configuration of this command node.
Definition: command_node.hpp:220
T CommandConfig() const
Gets and sets the command value configuration of this command node.
Definition: command_node.hpp:163
bool IsDone() const
If this command is readable, the execution state can be queried.
Definition: command_node.hpp:107
void FromString(const String &value) override
Executes if value is "true".
Definition: command_node.hpp:230
GenApi::CacheMode CacheMode() const override
Gets the cache mode by querying all ValueConfigs for it.
Definition: command_node.hpp:84
T ValueConfig() const
Gets and sets the value configuration of this command node.
Definition: command_node.hpp:201
GenApi::AccessMode AccessMode() const override
Gets the access mode by querying all ValueConfigs for it.
Definition: command_node.hpp:70
void SetCommandConfig(const T &)
Sets the command value configuration of this command node.
Definition: command_node.hpp:182
String ToString() const override
Gets the IsDone status as a string.
Definition: command_node.hpp:251
std::chrono::duration< Rep, Period > PollingTime() const
Gets the polling time of this value.
Definition: command_node.hpp:130
Basic GevServer node for device feature access.
Definition: decl_node.hpp:36
static GevServer::Namespace ParseNamespace(const String &name)
Gets the Namespace from the given name .
Definition: decl_node.hpp:567
static String EnsureNodeNameOnly(const String &name)
Throws if the given name has a namespace prefix.
Definition: decl_node.hpp:540
static String ParseName(const String &name)
Gets the name part of the given node name .
Definition: decl_node.hpp:588
void * Handle() const noexcept
Classic API node handle.
Definition: decl_node.hpp:100
Base class for all nodes that have a value.
Definition: value_node.hpp:24
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:147
std::shared_ptr< IntegerBaseNode > IntegerBaseNodePtr
Convenience shared pointer for IntegerBaseNode.
Definition: gevserver.hpp:64
@ PollingTime
Gets the polling time in ms.
@ Value
Accesses the value configuration.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24