5 #include "../global.hpp" 7 #include "integer_base_node.hpp" 8 #include "value_node.hpp" 11 #include "_detail/iconfigurable_boolean_node.hpp" 12 #include "_detail/ihas_value_config.hpp" 26 ,
public Private::IConfigurableBooleanNode
27 ,
public Private::IHasValueConfig<IntegerBaseNodePtr>
46 return std::make_shared<BooleanNode>(HandleGuard<Node>(
47 CExports::CreateGSBooleanNodeTyped(okName.data(), static_cast<CExports::TGSNamespace>(nameSpace))));
71 auto value = GetTerminalRegisterNode<BooleanNode, IntegerBaseNodePtr>(
this, [](
Node *node) {
72 auto hasValueConfig =
dynamic_cast<Private::IHasValueConfig<IntegerBaseNodePtr> *
>(node);
73 return (dynamic_cast<GenApi::Private::IRegisterNode *>(node) || !hasValueConfig->ValueConfigAsNode()) ?
true 79 return value->AccessMode();
88 auto value = GetTerminalRegisterNode<BooleanNode, IntegerBaseNodePtr>(
this, [](
Node *node) {
89 auto hasValueConfig =
dynamic_cast<Private::IHasValueConfig<IntegerBaseNodePtr> *
>(node);
90 return (dynamic_cast<GenApi::Private::IRegisterNode *>(node) || !hasValueConfig->ValueConfigAsNode()) ?
true 96 return value->CacheMode();
105 auto value = GetTerminalRegisterNode<BooleanNode, IntegerBaseNodePtr>(
this, [](
Node *node) {
106 auto isRegisterNode = dynamic_cast<GenApi::Private::IRegisterNode *>(node);
107 auto isCommandNode = dynamic_cast<GenApi::Private::ICommandNode *>(node);
108 return (isRegisterNode || isCommandNode) ? true :
false;
110 if (value ==
nullptr)
113 return value->template PollingTime<Rep, Period>();
155 return (NativeCall<CExports::cvbbool_t>(
156 [&](CExports::cvbbool_t &value) {
return CVB_CALL_CAPI(GSNGetAsBoolean(
Handle(), value)); }))
168 NativeCall([&]() {
return CVB_CALL_CAPI(GSNSetAsBoolean(
Handle(), static_cast<CExports::cvbbool_t>(value))); });
181 throw std::runtime_error(
"requested value config type must be derived from IntegerBaseNode or be " 202 "IntegerBaseNode or be of integral type");
215 std::transform(str.begin(), str.end(), str.begin(), [](
char ch)
217 return static_cast<char>(std::tolower(ch));
221 is >> std::boolalpha >> b;
234 template <>
inline std::int64_t BooleanNode::ValueConfig<std::int64_t>()
const 239 template <>
inline void BooleanNode::SetValueConfig<std::int64_t>(
const std::int64_t &value)
void FromString(const String &value) override
Sets this node's value from the string value .
Definition: boolean_node.hpp:209
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 BooleanNodePtr Create(const String &name)
Creates a new BooleanNode with the given name .
Definition: boolean_node.hpp:63
static BooleanNodePtr Create(const String &name, const GevServer::Namespace &nameSpace)
Creates a new BooleanNode with the given name and nameSpace .
Definition: boolean_node.hpp:43
static GevServer::Namespace ParseNamespace(const String &name)
Gets the Namespace from the given name .
Definition: decl_node.hpp:584
void SetValue(bool value)
Sets the value of this boolean node.
Definition: boolean_node.hpp:166
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
Root namespace for the Image Manager interface.
Definition: version.hpp:11
String ToString() const override
Gets the string representation of this node.
Definition: boolean_node.hpp:231
GenApi::AccessMode AccessMode() const override
Gets the access mode by querying all ValueConfigs for it.
Definition: boolean_node.hpp:69
GenApi::BooleanNode that is configurable.
Definition: boolean_node.hpp:23
std::chrono::duration< Rep, Period > PollingTime() const
Gets the polling time by querying all ValueConfigs for it.
Definition: boolean_node.hpp:103
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:146
Node can be read and written to.
T ValueConfig() const
Gets the value configuration of this boolean node.
Definition: boolean_node.hpp:179
Boolean specific: accesses the integer value for false.
bool Value() const
Gets the value of this boolean node.
Definition: boolean_node.hpp:153
Accesses the value configuration.
Basic GevServer node for device feature access.
Definition: decl_node.hpp:37
void SetValueConfig(const T &)
Sets the value configuration of this boolean node.
Definition: boolean_node.hpp:199
GenApi::CacheMode CacheMode() const override
Gets the cache mode by querying all ValueConfigs for it.
Definition: boolean_node.hpp:86
std::int64_t OnValue() const
Gets the value to be written if GenApi::IBooleanNode.Value is set to true.
Definition: boolean_node.hpp:136
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:130
std::int64_t OffValue() const
Gets the value to be written if GenApi::IBooleanNode.Value is set to false.
Definition: boolean_node.hpp:120
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