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;
253 template <>
inline std::int64_t CommandNode::CommandConfig<std::int64_t>()
const 258 template <>
inline IntegerBaseNodePtr CommandNode::CommandConfig<IntegerBaseNodePtr>()
const 263 template <>
inline void CommandNode::SetCommandConfig<std::int64_t>(
const std::int64_t &value)
268 template <>
inline std::int64_t CommandNode::ValueConfig<std::int64_t>()
const 273 template <>
inline void CommandNode::SetValueConfig<std::int64_t>(
const std::int64_t &value)
void SetCommandConfig(const T &)
Sets the command value configuration of this command node.
Definition: command_node.hpp:181
GenApi::AccessMode AccessMode() const override
Gets the access mode by querying all ValueConfigs for it.
Definition: command_node.hpp:69
static CommandNodePtr Create(const String &name)
Creates a new CommandNode with the given name .
Definition: command_node.hpp:63
void Execute()
Executes this command.
Definition: command_node.hpp:117
Base class for all nodes that have a value.
Definition: value_node.hpp:27
static String ParseName(const String &name)
Gets the name part of the given node name .
Definition: decl_node.hpp:606
static GevServer::Namespace ParseNamespace(const String &name)
Gets the Namespace from the given name .
Definition: decl_node.hpp:584
Namespace
The possible name spaces a node can be in.
Definition: gevserver.hpp:147
static String EnsureNodeNameOnly(const String &name)
Throws if the given name has a namespace prefix.
Definition: decl_node.hpp:557
void SetPollingTime(const std::chrono::duration< Rep, Period > ×pan)
Sets the polling time of this value.
Definition: command_node.hpp:145
Root namespace for the Image Manager interface.
Definition: version.hpp:11
Node can be read and written to.
A node that can be executed.
Definition: command_node.hpp:23
std::chrono::duration< Rep, Period > PollingTime() const
Gets the polling time of this value.
Definition: command_node.hpp:129
Accesses the value configuration.
T ValueConfig() const
Gets and sets the value configuration of this command node.
Definition: command_node.hpp:200
bool IsStreamable() const override
Commands are never streamable.
Definition: command_node.hpp:96
void FromString(const String &value) override
Executes if value is "true".
Definition: command_node.hpp:229
bool IsDone() const
If this command is readable, the execution state can be queried.
Definition: command_node.hpp:106
void SetValueConfig(const T &)
Sets the value configuration of this command node.
Definition: command_node.hpp:219
GenApi::CacheMode CacheMode() const override
Gets the cache mode by querying all ValueConfigs for it.
Definition: command_node.hpp:83
Basic GevServer node for device feature access.
Definition: decl_node.hpp:37
String ToString() const override
Gets the IsDone status as a string.
Definition: command_node.hpp:250
std::shared_ptr< IntegerBaseNode > IntegerBaseNodePtr
Convenience shared pointer for IntegerBaseNode.
Definition: gevserver.hpp:65
T CommandConfig() const
Gets and sets the command value configuration of this command node.
Definition: command_node.hpp:162
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
void * Handle() const noexcept
Classic API node handle.
Definition: decl_node.hpp:101
CacheMode
Defines how the value is cached.
Definition: genapi.hpp:219
AccessMode
Access possibility of the node.
Definition: genapi.hpp:184
Gets the polling time in ms.