5#include "../global.hpp"
7#include "integer_base_node.hpp"
8#include "value_node.hpp"
11#include "_detail/ihas_value_config.hpp"
12#include "_detail/iconfigurable_register_node.hpp"
13#include "_detail/iconfigurable_command_node.hpp"
27 ,
public Private::IHasValueConfig<IntegerBaseNodePtr>
31 explicit BooleanNode(HandleGuard<Node> &&guard)
50 CExports::CreateGSBooleanNodeTyped(okName.data(),
static_cast<CExports::TGSNamespace
>(nameSpace))));
78 auto hasValueConfig =
dynamic_cast<Private::IHasValueConfig<IntegerBaseNodePtr> *
>(node);
79 return (
dynamic_cast<Private::IConfigurableRegisterNode *
>(node) || !hasValueConfig->ValueConfigAsNode())
86 return value->AccessMode();
96 auto hasValueConfig =
dynamic_cast<Private::IHasValueConfig<IntegerBaseNodePtr> *
>(node);
97 return (
dynamic_cast<Private::IConfigurableRegisterNode *
>(node) || !hasValueConfig->ValueConfigAsNode())
101 if (value ==
nullptr)
104 return value->CacheMode();
111 template <
class Rep,
class Period>
115 auto isRegisterNode =
dynamic_cast<Private::IConfigurableRegisterNode *
>(node);
116 auto isCommandNode =
dynamic_cast<Private::IConfigurableCommandNode *
>(node);
117 return (isRegisterNode || isCommandNode) ? true :
false;
119 if (value ==
nullptr)
176 return (NativeCall<CExports::cvbbool_t>(
177 [&](CExports::cvbbool_t &value) {
return CVB_CALL_CAPI(GSNGetAsBoolean(
Handle(), value)); }))
189 NativeCall([&]() {
return CVB_CALL_CAPI(GSNSetAsBoolean(
Handle(),
static_cast<CExports::cvbbool_t
>(value))); });
204 "requested value config type must be derived from IntegerBaseNode or be "
226 "requested command config type must be derived from "
227 "IntegerBaseNode or be of integral type");
241 [](
char ch) { return static_cast<char>(std::tolower(ch)); });
256 return Value() ? CVB_LIT(
"true") : CVB_LIT(
"false");
24 class BooleanNode {
…};
261 inline std::int64_t BooleanNode::ValueConfig<std::int64_t>()
const
267 inline void BooleanNode::SetValueConfig<std::int64_t>(
const std::int64_t &value)
void SetOffValue(const std::int64_t &value)
Sets the value to be written if GenApi::IBooleanNode.Value is set to false.
Definition boolean_node.hpp:142
void SetValue(bool value)
Sets the value of this boolean node.
Definition boolean_node.hpp:187
std::int64_t OffValue() const
Gets the value to be written if GenApi::IBooleanNode.Value is set to false.
Definition boolean_node.hpp:129
bool Value() const
Gets the value of this boolean node.
Definition boolean_node.hpp:174
void SetValueConfig(const T &)
Sets the value configuration of this boolean node.
Definition boolean_node.hpp:223
static BooleanNodePtr Create(const String &name)
Creates a new BooleanNode with the given name .
Definition boolean_node.hpp:66
void FromString(const String &value) override
Sets this node's value from the string value .
Definition boolean_node.hpp:234
void SetOnValue(const std::int64_t &value)
Sets the value to be written if GenApi::IBooleanNode.Value is set to true.
Definition boolean_node.hpp:164
std::int64_t OnValue() const
Gets the value to be written if GenApi::IBooleanNode.Value is set to true.
Definition boolean_node.hpp:151
GenApi::CacheMode CacheMode() const override
Gets the cache mode by querying all ValueConfigs for it.
Definition boolean_node.hpp:93
T ValueConfig() const
Gets the value configuration of this boolean node.
Definition boolean_node.hpp:201
GenApi::AccessMode AccessMode() const override
Gets the access mode by querying all ValueConfigs for it.
Definition boolean_node.hpp:75
static BooleanNodePtr Create(const String &name, const GevServer::Namespace &nameSpace)
Creates a new BooleanNode with the given name and nameSpace .
Definition boolean_node.hpp:46
String ToString() const override
Gets the string representation of this node.
Definition boolean_node.hpp:254
std::chrono::duration< Rep, Period > PollingTime() const
Gets the polling time by querying all ValueConfigs for it.
Definition boolean_node.hpp:112
Basic GevServer node for device feature access.
Definition decl_node.hpp:34
static GevServer::Namespace ParseNamespace(const String &name)
Gets the Namespace from the given name .
Definition decl_node.hpp:591
static String EnsureNodeNameOnly(const String &name)
Throws if the given name has a namespace prefix.
Definition decl_node.hpp:564
static String ParseName(const String &name)
Gets the name part of the given node name .
Definition decl_node.hpp:611
ValueNodePtr GetTerminalRegisterNode(const NodeT *node, std::function< bool(Node *)> f) const
Try to get terminal register node.
Definition detail_node.hpp:708
void * Handle() const noexcept
Classic API node handle.
Definition decl_node.hpp:102
CacheMode
Defines how the value is cached.
Definition genapi.hpp:218
@ NoCache
No caching used.
Definition genapi.hpp:220
AccessMode
Access possibility of the node.
Definition genapi.hpp:183
@ ReadWrite
Node can be read and written to.
Definition genapi.hpp:213
Describes a GenICam Pixel Format Naming Convention (PFNC) compatible image memory buffer with possibl...
Definition decl_int_swiss_knife_node.hpp:11
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
std::shared_ptr< BooleanNode > BooleanNodePtr
Convenience shared pointer for BooleanNode.
Definition gevserver.hpp:56
@ OnValue
Definition gevserver.hpp:211
@ Value
Accesses the value configuration.
Definition gevserver.hpp:210
@ OffValue
Boolean specific: accesses the integer value for false.
Definition gevserver.hpp:213
@ String
Node is a string node (no reg).
Definition gevserver.hpp:168
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17