CVB++ 15.0
decl_int_swiss_knife_node.hpp
1#pragma once
2
3#include "../../global.hpp"
4
5#include "../../gevserver/integer_base_node.hpp"
6
7namespace Cvb
8{
9 CVB_BEGIN_INLINE_NS
10 namespace GevServer
11 {
27 class IntSwissKnifeNode : public IntegerBaseNode
28 {
29 public:
30 explicit IntSwissKnifeNode(HandleGuard<Node> &&guard)
31 : IntegerBaseNode(std::move(guard))
32 {
33 }
34
45 static IntSwissKnifeNodePtr Create(const String &name, const GevServer::Namespace &nameSpace)
46 {
47 String okName = EnsureNodeNameOnly(name);
48 return std::make_shared<IntSwissKnifeNode>(HandleGuard<Node>(
49 CExports::CreateGSIntSwissKnifeNodeTyped(okName.data(), static_cast<CExports::TGSNamespace>(nameSpace))));
50 }
51
67 {
68 return Create(ParseName(name), ParseNamespace(name));
69 }
70
76 {
78 }
79
85 {
87 }
88
93 template <class Rep, class Period>
98
114
120 {
121 return GetInfoAsString(NodeInfo::Formula);
122 }
123
200 void SetFormula(const String &value)
201 {
202 SetInfo(NodeInfo::Formula, value);
203 }
204
218 void Add(const NodePtr &item, const NodeList &kind, const String &key);
219 };
220 } // namespace GevServer
221 CVB_END_INLINE_NS
222} // namespace Cvb
String Formula() const
Formula that is evaluated when the value is read.
Definition decl_int_swiss_knife_node.hpp:119
static IntSwissKnifeNodePtr Create(const String &name, const GevServer::Namespace &nameSpace)
Creates a new IntSwissKnifeNode with the given name and nameSpace .
Definition decl_int_swiss_knife_node.hpp:45
GenApi::CacheMode CacheMode() const override
Here we may have multiple ones and can give no sane answer.
Definition decl_int_swiss_knife_node.hpp:84
GenApi::AccessMode AccessMode() const override
Swiss knifes are always read only.
Definition decl_int_swiss_knife_node.hpp:75
void Add(const NodePtr &item, const NodeList &kind, const String &key)
Adds a Node item with a key string.
Definition detail_int_swiss_knife_node.hpp:14
std::vector< IntegerBaseNodePtr > Variables() const
Dictionary containing all variables of this node.
Definition decl_int_swiss_knife_node.hpp:110
void SetFormula(const String &value)
Formula that is evaluated when the value is read.
Definition decl_int_swiss_knife_node.hpp:200
static IntSwissKnifeNodePtr Create(const String &name)
Creates a new IntSwissKnifeNode with the given name .
Definition decl_int_swiss_knife_node.hpp:66
std::chrono::duration< Rep, Period > PollingTime() const
Always time span zero as there may be multiple values.
Definition decl_int_swiss_knife_node.hpp:94
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
std::vector< std::shared_ptr< T > > GetDependentNodes(const NodeList &type) const
Gets the nodes categorized by this node.
Definition detail_node.hpp:410
T make_shared(T... args)
T move(T... args)
CacheMode
Defines how the value is cached.
Definition genapi.hpp:223
@ NoCache
No caching used.
Definition genapi.hpp:225
AccessMode
Access possibility of the node.
Definition genapi.hpp:188
@ ReadOnly
Node can only be read.
Definition genapi.hpp:214
Namespace for GevServer based device configuration.
Definition decl_int_swiss_knife_node.hpp:11
Namespace
The possible name spaces a node can be in.
Definition gevserver.hpp:156
std::shared_ptr< Node > NodePtr
Convenience shared pointer for Node.
Definition gevserver.hpp:41
@ Formula
Formula for swiss knife nodes.
Definition gevserver.hpp:223
@ String
Node is a string node (no reg).
Definition gevserver.hpp:177
std::shared_ptr< IntSwissKnifeNode > IntSwissKnifeNodePtr
Convenience shared pointer for IntSwissKnifeNode.
Definition gevserver.hpp:129
NodeList
Node access.
Definition gevserver.hpp:258
@ Child
Definition gevserver.hpp:259
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17