IDS peak genericC++  v1.7.1
peak::core::nodes::Node Class Reference

Represents a GenAPI node. More...

#include <peak/node_map/peak_node.hpp>

Inheritance diagram for peak::core::nodes::Node:
peak::core::nodes::BooleanNode peak::core::nodes::CategoryNode peak::core::nodes::CommandNode peak::core::nodes::EnumerationEntryNode peak::core::nodes::EnumerationNode peak::core::nodes::FloatNode peak::core::nodes::IntegerNode peak::core::nodes::RegisterNode peak::core::nodes::StringNode

Public Types

using ChangedCallback = std::function< void(const std::shared_ptr< Node > &changedNode)>
 
using ChangedCallbackHandle = ChangedCallback *
 

Public Member Functions

 Node ()=delete
 
virtual ~Node ()
 
 Node (const Node &other)=delete
 
Node & operator= (const Node &other)=delete
 
 Node (Node &&other)=delete
 
Node & operator= (Node &&other)=delete
 
std::string Name () const
 Returns the name. More...
 
std::string DisplayName () const
 Returns the display name. More...
 
NodeNamespace Namespace () const
 Returns the namespace the node belongs to. More...
 
NodeVisibility Visibility () const
 Returns the visibility. More...
 
NodeAccessStatus AccessStatus () const
 Returns the access status. More...
 
bool IsCacheable () const
 Checks whether the node is cacheable. More...
 
bool IsAccessStatusCacheable () const
 Checks whether the node's access status is cacheable. More...
 
bool IsStreamable () const
 Checks whether the node is streamable. More...
 
bool IsDeprecated () const
 Checks whether the node is deprecated. More...
 
bool IsFeature () const
 Checks whether the node is a feature, i.e. it can be reached via category nodes from a category node named "Root". More...
 
NodeCachingMode CachingMode () const
 Returns the caching mode. More...
 
int64_t PollingTime () const
 Returns the polling time. More...
 
std::string ToolTip () const
 Returns the tool tip. More...
 
std::string Description () const
 Returns the description. More...
 
NodeType Type () const
 Returns the type. More...
 
std::shared_ptr< NodeMap > ParentNodeMap () const
 Returns the parent node map. More...
 
std::shared_ptr< Node > FindInvalidatedNode (const std::string &name) const
 Tries to find an invalidated node with the given name. More...
 
template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr< NodeType > FindInvalidatedNode (const std::string &name) const
 Tries to find an invalidated node with the given name and type. More...
 
std::vector< std::shared_ptr< Node > > InvalidatedNodes () const
 Returns the invalidated nodes. More...
 
std::shared_ptr< Node > FindInvalidatingNode (const std::string &name) const
 Tries to find an invalidating node with the given name. More...
 
template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr< NodeType > FindInvalidatingNode (const std::string &name) const
 Tries to find an invalidating node with the given name and type. More...
 
std::vector< std::shared_ptr< Node > > InvalidatingNodes () const
 Returns the invalidating nodes. More...
 
std::shared_ptr< Node > FindSelectedNode (const std::string &name) const
 Tries to find a selected node with the given name. More...
 
template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr< NodeType > FindSelectedNode (const std::string &name) const
 Tries to find a selected node with the given name and type. More...
 
std::vector< std::shared_ptr< Node > > SelectedNodes () const
 Returns the selected nodes. More...
 
std::shared_ptr< Node > FindSelectingNode (const std::string &name) const
 Tries to find a selecting node with the given name. More...
 
template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr< NodeType > FindSelectingNode (const std::string &name) const
 Tries to find a selecting node with the given name and type. More...
 
std::vector< std::shared_ptr< Node > > SelectingNodes () const
 Returns the selecting nodes. More...
 
ChangedCallbackHandle RegisterChangedCallback (const ChangedCallback &callback)
 Registers a callback for signaling a change to the node. More...
 
void UnregisterChangedCallback (ChangedCallbackHandle callbackHandle)
 Unregisters a changed callback. More...
 

Detailed Description

Represents a GenAPI node.

This class allows to interact with a single node of a module. It is the base class for all nodes a module can have.

Member Typedef Documentation

◆ ChangedCallback

using peak::core::nodes::Node::ChangedCallback = std::function<void(const std::shared_ptr<Node>& changedNode)>

The type of changed callbacks.

◆ ChangedCallbackHandle

The type of changed callback handles.

Constructor & Destructor Documentation

◆ Node() [1/3]

peak::core::nodes::Node::Node ( )
delete

◆ ~Node()

peak::core::nodes::Node::~Node ( )
inlinevirtual

◆ Node() [2/3]

peak::core::nodes::Node::Node ( const Node &  other)
delete

◆ Node() [3/3]

peak::core::nodes::Node::Node ( Node &&  other)
delete

Member Function Documentation

◆ AccessStatus()

NodeAccessStatus peak::core::nodes::Node::AccessStatus ( ) const
inline

Returns the access status.

Returns
Access status
Since
1.0
Exceptions
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ CachingMode()

NodeCachingMode peak::core::nodes::Node::CachingMode ( ) const
inline

Returns the caching mode.

Returns
Caching mode
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Description()

std::string peak::core::nodes::Node::Description ( ) const
inline

Returns the description.

Returns
Description
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ DisplayName()

std::string peak::core::nodes::Node::DisplayName ( ) const
inline

Returns the display name.

Returns
Display name
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ FindInvalidatedNode() [1/2]

std::shared_ptr< Node > peak::core::nodes::Node::FindInvalidatedNode ( const std::string &  name) const
inline

Tries to find an invalidated node with the given name.

Parameters
[in]nameThe name of the invalidated node to find.
Returns
Found node.
If no invalidated node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no invalidated node with the given name
InternalErrorExceptionAn internal error has occurred.

◆ FindInvalidatedNode() [2/2]

template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr<NodeType> peak::core::nodes::Node::FindInvalidatedNode ( const std::string &  name) const
inline

Tries to find an invalidated node with the given name and type.

Parameters
[in]nameThe name of the invalidated node to find.
Returns
Found node.
If no invalidated node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no invalidated node with the given name
InvalidCastExceptionThe found node cannot be cast to the given type
InternalErrorExceptionAn internal error has occurred.

◆ FindInvalidatingNode() [1/2]

std::shared_ptr< Node > peak::core::nodes::Node::FindInvalidatingNode ( const std::string &  name) const
inline

Tries to find an invalidating node with the given name.

Parameters
[in]nameThe name of the invalidating node to find.
Returns
Found node.
If no invalidating node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no invalidating node with the given name
InternalErrorExceptionAn internal error has occurred.

◆ FindInvalidatingNode() [2/2]

template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr<NodeType> peak::core::nodes::Node::FindInvalidatingNode ( const std::string &  name) const
inline

Tries to find an invalidating node with the given name and type.

Parameters
[in]nameThe name of the invalidating node to find.
Returns
Found node.
If no invalidating node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no invalidating node with the given name
InvalidCastExceptionThe found node cannot be cast to the given type
InternalErrorExceptionAn internal error has occurred.

◆ FindSelectedNode() [1/2]

std::shared_ptr< Node > peak::core::nodes::Node::FindSelectedNode ( const std::string &  name) const
inline

Tries to find a selected node with the given name.

Parameters
[in]nameThe name of the selected node to find.
Returns
Found node.
If no selected node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no selected node with the given name
InternalErrorExceptionAn internal error has occurred.

◆ FindSelectedNode() [2/2]

template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr<NodeType> peak::core::nodes::Node::FindSelectedNode ( const std::string &  name) const
inline

Tries to find a selected node with the given name and type.

Parameters
[in]nameThe name of the selected node to find.
Returns
Found node.
If no selected node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no selected node with the given name
InvalidCastExceptionThe found node cannot be cast to the given type
InternalErrorExceptionAn internal error has occurred.

◆ FindSelectingNode() [1/2]

std::shared_ptr< Node > peak::core::nodes::Node::FindSelectingNode ( const std::string &  name) const
inline

Tries to find a selecting node with the given name.

Parameters
[in]nameThe name of the selecting node to find.
Returns
Found node.
If no selecting node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no selecting node with the given name
InternalErrorExceptionAn internal error has occurred.

◆ FindSelectingNode() [2/2]

template<class NodeType , typename std::enable_if< std::is_base_of< Node, NodeType >::value, int >::type = 0>
std::shared_ptr<NodeType> peak::core::nodes::Node::FindSelectingNode ( const std::string &  name) const
inline

Tries to find a selecting node with the given name and type.

Parameters
[in]nameThe name of the selecting node to find.
Returns
Found node.
If no selecting node with the given name exists, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no selecting node with the given name
InvalidCastExceptionThe found node cannot be cast to the given type
InternalErrorExceptionAn internal error has occurred.

◆ InvalidatedNodes()

std::vector< std::shared_ptr< Node > > peak::core::nodes::Node::InvalidatedNodes ( ) const
inline

Returns the invalidated nodes.

Returns
Invalidated nodes
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ InvalidatingNodes()

std::vector< std::shared_ptr< Node > > peak::core::nodes::Node::InvalidatingNodes ( ) const
inline

Returns the invalidating nodes.

Returns
Invalidating nodes
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsAccessStatusCacheable()

bool peak::core::nodes::Node::IsAccessStatusCacheable ( ) const
inline

Checks whether the node's access status is cacheable.

Returns
True, if the node's access status is cacheable.
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsCacheable()

bool peak::core::nodes::Node::IsCacheable ( ) const
inline

Checks whether the node is cacheable.

Returns
True, if the node is cacheable.
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsDeprecated()

bool peak::core::nodes::Node::IsDeprecated ( ) const
inline

Checks whether the node is deprecated.

Returns
True, if the node is deprecated.
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsFeature()

bool peak::core::nodes::Node::IsFeature ( ) const
inline

Checks whether the node is a feature, i.e. it can be reached via category nodes from a category node named "Root".

Returns
True, if the node is a feature.
False otherwise.
Since
1.2
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsStreamable()

bool peak::core::nodes::Node::IsStreamable ( ) const
inline

Checks whether the node is streamable.

Returns
True, if the node is streamable.
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Name()

std::string peak::core::nodes::Node::Name ( ) const
inline

Returns the name.

Returns
Name
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Namespace()

NodeNamespace peak::core::nodes::Node::Namespace ( ) const
inline

Returns the namespace the node belongs to.

Returns
Namespace the node belongs to
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ operator=() [1/2]

Node& peak::core::nodes::Node::operator= ( const Node &  other)
delete

◆ operator=() [2/2]

Node& peak::core::nodes::Node::operator= ( Node &&  other)
delete

◆ ParentNodeMap()

std::shared_ptr< peak::core::NodeMap > peak::core::nodes::Node::ParentNodeMap ( ) const
inline

Returns the parent node map.

Returns
Parent node map
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ PollingTime()

int64_t peak::core::nodes::Node::PollingTime ( ) const
inline

Returns the polling time.

Returns
Polling time in milliseconds
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ RegisterChangedCallback()

Node::ChangedCallbackHandle peak::core::nodes::Node::RegisterChangedCallback ( const ChangedCallback &  callback)
inline

Registers a callback for signaling a change to the node.

This function registers a callback which gets called every time the node changes. Pass the callback handle returned by this function to UnregisterChangedCallback() to unregister the callback.

Parameters
[in]callbackThe callback to call if the node has changed.
Returns
Callback handle
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ SelectedNodes()

std::vector< std::shared_ptr< Node > > peak::core::nodes::Node::SelectedNodes ( ) const
inline

Returns the selected nodes.

Returns
Selected nodes
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ SelectingNodes()

std::vector< std::shared_ptr< Node > > peak::core::nodes::Node::SelectingNodes ( ) const
inline

Returns the selecting nodes.

Returns
Selecting nodes
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ ToolTip()

std::string peak::core::nodes::Node::ToolTip ( ) const
inline

Returns the tool tip.

Returns
Tool tip
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Type()

NodeType peak::core::nodes::Node::Type ( ) const
inline

Returns the type.

The returned type is necessary to know the type the node has to be casted to if you want to access the full functionality of the node.

Returns
Type
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ UnregisterChangedCallback()

void peak::core::nodes::Node::UnregisterChangedCallback ( Node::ChangedCallbackHandle  callbackHandle)
inline

Unregisters a changed callback.

This function unregisters a changed callback by taking its handle.

Parameters
[in]callbackHandleThe handle of the callback to unregister.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Visibility()

NodeVisibility peak::core::nodes::Node::Visibility ( ) const
inline

Returns the visibility.

Returns
Visibility
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

The documentation for this class was generated from the following file: