IDS peak genericC++ v1.13.0
Loading...
Searching...
No Matches
peak::core::nodes::EnumerationNode Class Reference

Represents a GenAPI enumeration node. More...

#include <peak/node_map/peak_enumeration_node.hpp>

Inheritance diagram for peak::core::nodes::EnumerationNode:
peak::core::nodes::Node

Public Types

using NodeDataType = std::string
using NodeHasRange = std::false_type
Public Types inherited from peak::core::nodes::Node
using ChangedCallback = std::function<void(const std::shared_ptr<Node>& changedNode)>
using ChangedCallbackHandle = ChangedCallback*

Public Member Functions

 EnumerationNode ()=delete
 ~EnumerationNode () override=default
 EnumerationNode (const EnumerationNode &other)=delete
EnumerationNode & operator= (const EnumerationNode &other)=delete
 EnumerationNode (EnumerationNode &&other)=delete
EnumerationNode & operator= (EnumerationNode &&other)=delete
std::shared_ptr< EnumerationEntryNode > CurrentEntry (NodeCacheUsePolicy cacheUsePolicy=NodeCacheUsePolicy::UseCache) const
 Returns the current entry.
void SetCurrentEntry (const std::shared_ptr< EnumerationEntryNode > &entry)
 Sets the current entry.
void SetCurrentEntry (const std::string &symbolicValue)
 Sets the current entry to an entry with the given symbolic value.
void SetCurrentEntry (int64_t value)
 Sets the current entry to an entry with the given value.
bool HasEntry (const std::string &symbolicValue) const
 Checks whether the enumeration node contains an entry with the given symbolic value.
bool HasEntry (int64_t value) const
 Checks whether the enumeration node contains an entry with the given value.
std::shared_ptr< EnumerationEntryNode > FindEntry (const std::string &symbolicValue) const
 Finds an entry with the given symbolic value.
std::shared_ptr< EnumerationEntryNode > FindEntry (int64_t value) const
 Finds an entry with the given numeric value.
std::shared_ptr< EnumerationEntryNode > TryFindEntry (const std::string &symbolicValue) const
 Tries to find an entry with the given symbolic value.
std::shared_ptr< EnumerationEntryNode > TryFindEntry (const int64_t value) const
 Tries to find a entry with the given numeric value.
std::vector< std::shared_ptr< EnumerationEntryNode > > Entries () const
 Returns the entries.
std::vector< std::shared_ptr< EnumerationEntryNode > > AvailableEntries () const
 Returns the currently selectable entries.
Public Member Functions inherited from peak::core::nodes::Node
 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.
std::string DisplayName () const
 Returns the display name.
NodeNamespace Namespace () const
 Returns the namespace the node belongs to.
NodeVisibility Visibility () const
 Returns the visibility.
NodeAccessStatus AccessStatus () const
 Returns the access status.
bool IsReadable () const
 Returns whether the node is currently readable.
bool IsWriteable () const
 Returns whether the node is currently writeable.
bool IsAvailable () const
 Returns whether the node is currently either readable or writeable.
bool IsImplemented () const
 Returns whether the node is implemented.
bool IsCacheable () const
 Checks whether the node is cacheable.
bool IsAccessStatusCacheable () const
 Checks whether the node's access status is cacheable.
bool IsStreamable () const
 Checks whether the node is streamable.
bool IsDeprecated () const
 Checks whether the node is deprecated.
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".
NodeCachingMode CachingMode () const
 Returns the caching mode.
int64_t PollingTime () const
 Returns the polling time.
std::string ToolTip () const
 Returns the tool tip.
std::string Description () const
 Returns the description.
NodeType Type () const
 Returns the type.
std::shared_ptr< NodeMap > ParentNodeMap () const
 Returns the parent node map.
std::shared_ptr< Node > FindInvalidatedNode (const std::string &name) const
 Tries to find an invalidated node with the given name.
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.
std::vector< std::shared_ptr< Node > > InvalidatedNodes () const
 Returns the invalidated nodes.
std::shared_ptr< Node > FindInvalidatingNode (const std::string &name) const
 Tries to find an invalidating node with the given name.
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.
std::vector< std::shared_ptr< Node > > InvalidatingNodes () const
 Returns the invalidating nodes.
std::shared_ptr< Node > FindSelectedNode (const std::string &name) const
 Tries to find a selected node with the given name.
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.
std::vector< std::shared_ptr< Node > > SelectedNodes () const
 Returns the selected nodes.
std::shared_ptr< Node > FindSelectingNode (const std::string &name) const
 Tries to find a selecting node with the given name.
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.
std::vector< std::shared_ptr< Node > > SelectingNodes () const
 Returns the selecting nodes.
ChangedCallbackHandle RegisterChangedCallback (const ChangedCallback &callback)
 Registers a callback for signaling a change to the node.
void UnregisterChangedCallback (ChangedCallbackHandle callbackHandle)
 Unregisters a changed callback.

Static Public Attributes

static constexpr auto NodeType = nodes::NodeType::Enumeration

Detailed Description

Represents a GenAPI enumeration node.

Member Typedef Documentation

◆ NodeDataType

◆ NodeHasRange

Constructor & Destructor Documentation

◆ EnumerationNode() [1/3]

peak::core::nodes::EnumerationNode::EnumerationNode ( )
delete

◆ ~EnumerationNode()

peak::core::nodes::EnumerationNode::~EnumerationNode ( )
overridedefault

◆ EnumerationNode() [2/3]

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

◆ EnumerationNode() [3/3]

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

Member Function Documentation

◆ AvailableEntries()

std::vector< std::shared_ptr< EnumerationEntryNode > > peak::core::nodes::EnumerationNode::AvailableEntries ( ) const
inline

Returns the currently selectable entries.

Returns
Selectable entries
Since
1.10.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ CurrentEntry()

std::shared_ptr< EnumerationEntryNode > peak::core::nodes::EnumerationNode::CurrentEntry ( NodeCacheUsePolicy cacheUsePolicy = NodeCacheUsePolicy::UseCache) const
inline

Returns the current entry.

Parameters
[in]cacheUsePolicyA flag telling whether the value should be read using the internal cache.
Returns
Current entry
Since
1.0
Exceptions
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ Entries()

std::vector< std::shared_ptr< EnumerationEntryNode > > peak::core::nodes::EnumerationNode::Entries ( ) const
inline

Returns the entries.

Returns
Entries
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ FindEntry() [1/2]

std::shared_ptr< EnumerationEntryNode > peak::core::nodes::EnumerationNode::FindEntry ( const std::string & symbolicValue) const
inline

Finds an entry with the given symbolic value.

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

◆ FindEntry() [2/2]

std::shared_ptr< EnumerationEntryNode > peak::core::nodes::EnumerationNode::FindEntry ( int64_t value) const
inline

Finds an entry with the given numeric value.

Parameters
[in]valueThe value of the entry to find.
Returns
Found entry.
If no entry with the given numeric value, a NotFoundException is thrown.
Since
1.0
Exceptions
NotFoundExceptionThere is no entry with the given numeric value.
InternalErrorExceptionAn internal error has occurred.

◆ HasEntry() [1/2]

bool peak::core::nodes::EnumerationNode::HasEntry ( const std::string & symbolicValue) const
inline

Checks whether the enumeration node contains an entry with the given symbolic value.

Note
This function only checks whether there is an entry with the given name. It does not check the access status whether the entry is available or implemented. To do so consider utilizing the function Node::IsAvailable.
Parameters
[in]symbolicValueThe symbolic value of the entry to find.
Since
1.10.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ HasEntry() [2/2]

bool peak::core::nodes::EnumerationNode::HasEntry ( int64_t value) const
inline

Checks whether the enumeration node contains an entry with the given value.

Note
This function only checks whether there is an entry with the given value. It does not check the access status whether the entry is available or implemented.
Parameters
[in]valueThe value of the entry to find.
Since
1.10.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ SetCurrentEntry() [1/3]

void peak::core::nodes::EnumerationNode::SetCurrentEntry ( const std::shared_ptr< EnumerationEntryNode > & entry)
inline

Sets the current entry.

Parameters
[in]entryThe entry to set as current entry.
Since
1.0
Exceptions
InvalidArgumentExceptionThere is no matching entry in this enumeration node.
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ SetCurrentEntry() [2/3]

void peak::core::nodes::EnumerationNode::SetCurrentEntry ( const std::string & symbolicValue)
inline

Sets the current entry to an entry with the given symbolic value.

Parameters
[in]symbolicValueThe symbolic value of the entry to set.
Since
1.0
Exceptions
InvalidArgumentExceptionThere is no entry with this symbolicValue in this enumeration node.
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ SetCurrentEntry() [3/3]

void peak::core::nodes::EnumerationNode::SetCurrentEntry ( int64_t value)
inline

Sets the current entry to an entry with the given value.

Parameters
[in]valueThe value of the entry to set.
Since
1.0
Exceptions
InvalidArgumentExceptionThere is no entry with this value in this enumeration node.
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ TryFindEntry() [1/2]

std::shared_ptr< EnumerationEntryNode > peak::core::nodes::EnumerationNode::TryFindEntry ( const int64_t value) const
inline

Tries to find a entry with the given numeric value.

Parameters
[in]valueThe value of the entry to find.
Returns
Found entry or nullptr if no entry with the given name exists.
Since
1.10.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ TryFindEntry() [2/2]

std::shared_ptr< EnumerationEntryNode > peak::core::nodes::EnumerationNode::TryFindEntry ( const std::string & symbolicValue) const
inline

Tries to find an entry with the given symbolic value.

Parameters
[in]symbolicValueThe symbolic value of the entry to find.
Returns
Found entry or nullptr if no entry with the given name exists.
Since
1.10.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

Member Data Documentation

◆ NodeType

auto peak::core::nodes::EnumerationNode::NodeType = nodes::NodeType::Enumeration
staticconstexpr

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