CVB++ 14.1
Node Class Reference

Basic GevServer node for device feature access. More...

#include <cvb/gevserver/node.hpp>

Inherited by DefaultNode, and ValueNode.

Public Member Functions

void Add (const NodePtr &item, const NodeList &kind)
 Adds a Node item . More...
 
bool Remove (const NodePtr &item, const NodeList &kind)
 Remove a single Node item from this collection. More...
 
void * Handle () const noexcept
 Classic API node handle. More...
 
NodeMapPtr NodeMap () const
 Gets the node map of this GevServer node.
 
String ToolTip () const
 Gets the short descriptive text of this node. More...
 
void SetToolTip (const String &value)
 Sets the short descriptive text of this node. More...
 
String Description () const
 Gets the long descriptive text of this node. More...
 
void SetDescription (const String &value)
 Sets the long descriptive text of this node. More...
 
virtual GenApi::AccessMode AccessMode () const
 Gets the GenApi::AccessMode of this node.
 
Cvb::GenApi::AccessMode ImposedAccessMode () const
 Gets the node's default AccessMode. More...
 
void SetImposedAccessMode (const Cvb::GenApi::AccessMode &accessMode)
 Overrides the node's default AccessMode.
 
bool IsImplemented () const
 Helper to check whether this node is implemented. More...
 
IntegerBaseNodePtr IsImplementedConfig () const
 Gets the node that specifies whether a node is implemented in the device or not.
 
void SetIsImplementedConfig (const IntegerBaseNodePtr &node)
 Sets the node that specifies whether a node is implemented in the device or not. More...
 
bool IsAvailable () const
 Helper to check whether this node is available. More...
 
IntegerBaseNodePtr IsAvailableConfig () const
 Gets the node that specifies whether a node is currently available or not. More...
 
void SetIsAvailableConfig (const IntegerBaseNodePtr &node)
 Sets the node that specifies whether a node is currently available or not. More...
 
bool IsReadable () const
 Helper to check whether this node is readable. More...
 
bool IsWritable () const
 Helper to check whether this node is writable. More...
 
IntegerBaseNodePtr IsLockedConfig () const
 Gets the node that specifies whether a node is currently read only or not. More...
 
void SetIsLockedConfig (const IntegerBaseNodePtr &node)
 Sets the node that specifies whether a node is currently read only or not. More...
 
virtual Cvb::GenApi::CacheMode CacheMode () const
 Gets the cache mode of this node. More...
 
Cvb::GenApi::Visibility Visibility () const
 Gets the complexity level of this node. More...
 
void SetVisibility (const Cvb::GenApi::Visibility &value)
 Gets the complexity level of this node. More...
 
NodePtr AliasNode () const
 Gets the node that is an alias value for this node. More...
 
void SetAliasNode (const NodePtr &value)
 Sets the node that is an alias value for this node. More...
 
String Name () const
 Gets the full name of this node. More...
 
String NameOnly () const
 Gets the name of this node without namespace. More...
 
GevServer::Namespace Namespace () const
 Gets the namespace this node is in. More...
 
String EventID () const
 Nodes with an event identifier may become invalidated if an event/message is delivered from the device. More...
 
bool IsFeature () const
 Gets whether this node is considered a feature node. More...
 
bool IsDeprecated () const
 Gets whether this node is considered deprecated. More...
 
String DisplayName () const
 Gets the display name of this node. More...
 
void SetDisplayName (const String &value)
 Sets the display name of this node. More...
 
EventCookie RegisterEventUpdated (std::function< void(Node &)> handler)
 Register a listener to node updated event. More...
 
void UnregisterEventUpdated (EventCookie eventCookie) noexcept
 Manually unregister a listener to the node updated event. More...
 
template<class NodeT , class ValueConfigNodeType >
ValueNodePtr GetTerminalRegisterNode (const NodeT *node, std::function< bool(Node *)> f) const
 Try to get terminal register node. More...
 

Static Public Member Functions

static NodePtr FromName (const NodeMapPtr &nodeMap, const String &name)
 Factory to create the appropriate Node object on the given nodeMap based on the given name . More...
 
template<class T , class... ARGS>
static std::shared_ptr< T > FromHandle (HandleGuard< Node > &&guard, ARGS &&... args)
 Factory to create the appropriate Node object based on the given handle . More...
 

Protected Member Functions

template<class T >
std::vector< std::shared_ptr< T > > GetDependentNodes (const NodeList &type) const
 Gets the nodes categorized by this node. More...
 

Static Protected Member Functions

static String EnsureNodeNameOnly (const String &name)
 Throws if the given name has a namespace prefix. More...
 
static NodePtr FromHandle (HandleGuard< Node > &&guard, const NodeMapPtr &nodeMap)
 Factory to create the appropriate Node object based on the given handle . More...
 
static GevServer::Namespace ParseNamespace (const String &name)
 Gets the Namespace from the given name . More...
 
static String ParseName (const String &name)
 Gets the name part of the given node name . More...
 
static GevServer::NodeType NodeType (void *handle)
 Gets the node type from the nodes native handle. More...
 

Detailed Description

Basic GevServer node for device feature access.

Member Function Documentation

◆ Add()

void Add ( const NodePtr item,
const NodeList kind 
)
inline

Adds a Node item .

Parameters
itemNode Object to add.
kindGevServer::NodeList Kind of node.

◆ AliasNode()

NodePtr AliasNode ( ) const
inline

Gets the node that is an alias value for this node.

Alias nodes give an additional view on a value or can contain summary information for e.g. CategoryNodes.

Returns
Alias node instance; null for none.

◆ CacheMode()

Cvb::GenApi::CacheMode CacheMode ( ) const
inlinevirtual

Gets the cache mode of this node.

Returns
The current cache mode.
Exceptions
Anyexception derived from std::exception including CvbException.

For non-register nodes the cache mode of the register in the value path of the node chain up the the register is used.

Reimplemented in CategoryNode, EnumEntryNode, IntSwissKnifeNode, BooleanNode, CommandNode, EnumerationNode, FloatNode, FloatRegNode, IntRegNode, IntegerNode, StringNode, and StringRegNode.

◆ Description()

String Description ( ) const
inline

Gets the long descriptive text of this node.

Returns
Long descriptive text.
Exceptions
Anyexception derived from std::exception including CvbException.

See ToolTip() for the short description.

◆ DisplayName()

String DisplayName ( ) const
inline

Gets the display name of this node.

Returns
Display name including namespace.
Exceptions
Anyexception derived from std::exception including CvbException.

String containing the name to display.

◆ EnsureNodeNameOnly()

static String EnsureNodeNameOnly ( const String name)
inlinestaticprotected

Throws if the given name has a namespace prefix.

Parameters
nameName to check.
Returns
The given name .

◆ EventID()

String EventID ( ) const
inline

Nodes with an event identifier may become invalidated if an event/message is delivered from the device.

Returns
The event ID as string.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FromHandle() [1/2]

static std::shared_ptr< T > FromHandle ( HandleGuard< Node > &&  guard,
ARGS &&...  args 
)
inlinestatic

Factory to create the appropriate Node object based on the given handle .

Parameters
guardNative node handle.
args.
Returns
New Node object.

◆ FromHandle() [2/2]

NodePtr FromHandle ( HandleGuard< Node > &&  guard,
const NodeMapPtr nodeMap 
)
inlinestaticprotected

Factory to create the appropriate Node object based on the given handle .

Parameters
guardHandle guard.
nodeMapNodemap pointer.
Returns
New Node object.

◆ FromName()

NodePtr FromName ( const NodeMapPtr nodeMap,
const String name 
)
inlinestatic

Factory to create the appropriate Node object on the given nodeMap based on the given name .

Parameters
nodeMapNative node map.
nameNative node name.
Returns
New Node object.

◆ GetDependentNodes()

std::vector< std::shared_ptr< T > > GetDependentNodes ( const NodeList type) const
inlineprotected

Gets the nodes categorized by this node.

Returns
Vector with all categorized nodes.
Exceptions
Doesnot throw any exception.

◆ GetTerminalRegisterNode()

ValueNodePtr GetTerminalRegisterNode ( const NodeT *  node,
std::function< bool(Node *)>  f 
) const
inline

Try to get terminal register node.

Returns
register node or nullptr if no register node found

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API node handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ ImposedAccessMode()

Cvb::GenApi::AccessMode ImposedAccessMode ( ) const
inline

Gets the node's default AccessMode.

Returns
Imposed access mode; null if no imposing is done or set to clear.

◆ IsAvailable()

bool IsAvailable ( ) const
inline

Helper to check whether this node is available.

Returns
True if the node is available, otherwise false.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ IsAvailableConfig()

IntegerBaseNodePtr IsAvailableConfig ( ) const
inline

Gets the node that specifies whether a node is currently available or not.

Returns
IConfigurableIntegerNode which states that this node is available when unequal zero. null for keeping the original AccessMode.

◆ IsDeprecated()

bool IsDeprecated ( ) const
inline

Gets whether this node is considered deprecated.

Returns
True if the node is deprecated, otherwise false.
Exceptions
Anyexception derived from std::exception including CvbException.

Deprecated nodes are only available because of backward compatibility. New applications should not use these features.

◆ IsFeature()

bool IsFeature ( ) const
inline

Gets whether this node is considered a feature node.

Returns
True if the node is a feature node, otherwise false.
Exceptions
Anyexception derived from std::exception including CvbException.

Feature nodes are in a way public/user interface nodes. All nodes that are directly referenced by the root node or other category nodes are considered features.

◆ IsImplemented()

bool IsImplemented ( ) const
inline

Helper to check whether this node is implemented.

Returns
True if the node is implemented, otherwise false.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ IsLockedConfig()

IntegerBaseNodePtr IsLockedConfig ( ) const
inline

Gets the node that specifies whether a node is currently read only or not.

Returns
IConfigurableIntegerNode which states that this node is read only when unequal zero. null for keeping the original AccessMode.

◆ IsReadable()

bool IsReadable ( ) const
inline

Helper to check whether this node is readable.

Returns
True if the node is readable, otherwise false.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ IsWritable()

bool IsWritable ( ) const
inline

Helper to check whether this node is writable.

Returns
True if the node is writable, otherwise false.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Name()

String Name ( ) const
inline

Gets the full name of this node.

Returns
Name including namespace.
Exceptions
Anyexception derived from std::exception including CvbException.

String containing the namespace of the node (Std or Cust and the node's name separated by double colons (::)).

◆ NameOnly()

String NameOnly ( ) const
inline

Gets the name of this node without namespace.

Returns
Name without namespace.
Exceptions
Anyexception derived from std::exception including CvbException.

String containing the namespace of the node (Std or Cust and the node's name separated by double colons (::)).

◆ Namespace()

GevServer::Namespace Namespace ( ) const
inline

Gets the namespace this node is in.

Namespace::Private nodes will not be in the GenApi XML description.

Returns
The namespace this node is in.

◆ NodeType()

static GevServer::NodeType NodeType ( void *  handle)
inlinestaticprotected

Gets the node type from the nodes native handle.

Parameters
[in]handleNative node handle
Returns
Type of the node.

◆ ParseName()

static String ParseName ( const String name)
inlinestaticprotected

Gets the name part of the given node name .

Parameters
nameName to get the name part of.
Returns
Name of the node.

◆ ParseNamespace()

static GevServer::Namespace ParseNamespace ( const String name)
inlinestaticprotected

Gets the Namespace from the given name .

Parameters
nameName to determine namespace of.
Returns
Namespace derived from name . If none is set Namespace::Custom is assumed.

◆ RegisterEventUpdated()

EventCookie RegisterEventUpdated ( std::function< void(Node &)>  handler)
inline

Register a listener to node updated event.

Parameters
[in]handlerListener, to node updated event.
Returns
Event cookie, to manually unregister the listener.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Remove()

bool Remove ( const NodePtr item,
const NodeList kind 
)
inline

Remove a single Node item from this collection.

Parameters
itemNode Object to remove.
kindGevServer::NodeList Kind of node to remove.
Returns
true if item was removed; false if not in this collection.

◆ SetAliasNode()

void SetAliasNode ( const NodePtr value)
inline

Sets the node that is an alias value for this node.

Alias nodes give an additional view on a value or can contain summary information for e.g. CategoryNodes.

Alias node instance; null for none.

◆ SetDescription()

void SetDescription ( const String value)
inline

Sets the long descriptive text of this node.

Parameters
[in]valueLong descriptive text.
Exceptions
Anyexception derived from std::exception including CvbException.

See ToolTip() for the short description.

◆ SetDisplayName()

void SetDisplayName ( const String value)
inline

Sets the display name of this node.

Parameters
[in]valueIn Display name including namespace.
Exceptions
Anyexception derived from std::exception including CvbException.

String containing the name to display.

◆ SetIsAvailableConfig()

void SetIsAvailableConfig ( const IntegerBaseNodePtr node)
inline

Sets the node that specifies whether a node is currently available or not.

Set operation is only possible as long as the GevServer::State is GevServer::State::Configuration.

IConfigurableIntegerNode which states that this node is available when unequal zero. null for keeping the original AccessMode.

◆ SetIsImplementedConfig()

void SetIsImplementedConfig ( const IntegerBaseNodePtr node)
inline

Sets the node that specifies whether a node is implemented in the device or not.

Set operation is only possible as long as the GevServer::State is GevServer::State::Configuration.

IConfigurableIntegerNode which states that this node is implemented when unequal zero. null for keeping the original AccessMode.

◆ SetIsLockedConfig()

void SetIsLockedConfig ( const IntegerBaseNodePtr node)
inline

Sets the node that specifies whether a node is currently read only or not.

Set operation is only possible as long as the GevServer::State is GevServer::State::Configuration.

IConfigurableIntegerNode which states that this node is read only when unequal zero. null for keeping the original AccessMode.

◆ SetToolTip()

void SetToolTip ( const String value)
inline

Sets the short descriptive text of this node.

Parameters
[in]valueThe tool tip text.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ SetVisibility()

void SetVisibility ( const Cvb::GenApi::Visibility value)
inline

Gets the complexity level of this node.

Exceptions
Anyexception derived from std::exception including CvbException.

◆ ToolTip()

String ToolTip ( ) const
inline

Gets the short descriptive text of this node.

Returns
The tool tip text.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UnregisterEventUpdated()

void UnregisterEventUpdated ( EventCookie  eventCookie)
inlinenoexcept

Manually unregister a listener to the node updated event.

Parameters
[in]eventCookieeventCookie Event cookie, obtained from registering the listener.
Exceptions
Doesnot throw any exception.

◆ Visibility()

Cvb::GenApi::Visibility Visibility ( ) const
inline

Gets the complexity level of this node.

Returns
The visibility of this node.
Exceptions
Anyexception derived from std::exception including CvbException.