IDS peak genericC++ v1.17.0
Loading...
Searching...
No Matches
peak_node.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
10
12#include <peak/dll_interface/peak_dll_interface_util.hpp>
13#include <peak/generic/peak_t_callback_manager.hpp>
14
15#include <type_traits>
16#include <cstddef>
17#include <cstdint>
18#include <functional>
19#include <memory>
20#include <string>
21#include <vector>
22
23
24namespace peak
25{
26namespace core
27{
28
29class NodeMap;
30
34namespace nodes
35{
36
50
71
77enum class NodeNamespace
78{
81};
82
99
111
113struct NodeChangedCallbackContainer;
115
124class Node : public std::enable_shared_from_this<Node>
125{
126public:
128 using ChangedCallback = std::function<void(const std::shared_ptr<Node>& changedNode)>;
131
132 Node() = delete;
133 virtual ~Node();
134 Node(const Node& other) = delete;
135 Node& operator=(const Node& other) = delete;
136 Node(Node&& other) = delete;
137 Node& operator=(Node&& other) = delete;
138
148 PEAK_COMMON_NO_DISCARD std::string Name() const;
149
159 PEAK_COMMON_NO_DISCARD std::string DisplayName() const;
160
171
182
194
204
214
224
234
248
262
274
286
299
312
324 PEAK_COMMON_NO_DISCARD int64_t PollingTime() const;
325
335 PEAK_COMMON_NO_DISCARD std::string ToolTip() const;
336
346 PEAK_COMMON_NO_DISCARD std::string Description() const;
347
361
371 PEAK_COMMON_NO_DISCARD std::shared_ptr<NodeMap> ParentNodeMap() const;
372
391 PEAK_COMMON_NO_DISCARD std::shared_ptr<Node> FindInvalidatedNode(const std::string& name) const;
392
410 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
411 PEAK_COMMON_NO_DISCARD std::shared_ptr<NodeType> FindInvalidatedNode(const std::string& name) const
412 {
413 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatedNode(name));
414 if (!castedNode)
415 {
416 throw InvalidCastException("Invalid node cast!");
417 }
418
419 return castedNode;
420 }
421
436 PEAK_COMMON_NO_DISCARD std::vector<std::shared_ptr<Node>> InvalidatedNodes() const;
437
456 PEAK_COMMON_NO_DISCARD std::shared_ptr<Node> FindInvalidatingNode(const std::string& name) const;
457
475 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
476 PEAK_COMMON_NO_DISCARD std::shared_ptr<NodeType> FindInvalidatingNode(const std::string& name) const
477 {
478 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatingNode(name));
479 if (!castedNode)
480 {
481 throw InvalidCastException("Invalid node cast!");
482 }
483
484 return castedNode;
485 }
486
501 PEAK_COMMON_NO_DISCARD std::vector<std::shared_ptr<Node>> InvalidatingNodes() const;
502
516 PEAK_COMMON_NO_DISCARD std::shared_ptr<Node> FindSelectedNode(const std::string& name) const;
517
532 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
533 PEAK_COMMON_NO_DISCARD std::shared_ptr<NodeType> FindSelectedNode(const std::string& name) const
534 {
535 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectedNode(name));
536 if (!castedNode)
537 {
538 throw InvalidCastException("Invalid node cast!");
539 }
540
541 return castedNode;
542 }
543
553 PEAK_COMMON_NO_DISCARD std::vector<std::shared_ptr<Node>> SelectedNodes() const;
554
568 PEAK_COMMON_NO_DISCARD std::shared_ptr<Node> FindSelectingNode(const std::string& name) const;
569
584 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
585 PEAK_COMMON_NO_DISCARD std::shared_ptr<NodeType> FindSelectingNode(const std::string& name) const
586 {
587 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectingNode(name));
588 if (!castedNode)
589 {
590 throw InvalidCastException("Invalid node cast!");
591 }
592
593 return castedNode;
594 }
595
605 PEAK_COMMON_NO_DISCARD std::vector<std::shared_ptr<Node>> SelectingNodes() const;
606
622
635
636protected:
638 Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap);
640private:
641 struct NodeChangedCallbackContainer
642 {
643 std::shared_ptr<Node> _Node;
644 Node::ChangedCallback Callback;
645 };
646 static void PEAK_CALL_CONV ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context);
647
648 friend ClassCreator<Node>;
649 PEAK_NODE_HANDLE m_backendHandle;
650
651 std::weak_ptr<NodeMap> m_parentNodeMap;
652
653 std::unique_ptr<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>
654 m_changedCallbackManager;
655};
656
657inline std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
658{
659 return QueryStringFromCInterfaceFunction([&](char* nodeName, size_t* nodeNameSize) {
660 return PEAK_C_ABI_PREFIX PEAK_Node_GetName(nodeHandle, nodeName, nodeNameSize);
661 });
662}
663
664} /* namespace nodes */
665} /* namespace core */
666} /* namespace peak */
667
669
670/* Implementation */
671namespace peak
672{
673namespace core
674{
675namespace nodes
676{
677
678inline std::string ToString(NodeAccessStatus entry)
679{
680 std::string entryString;
681
683 {
684 entryString = "NotImplemented";
685 }
686 else if (entry == NodeAccessStatus::NotAvailable)
687 {
688 entryString = "NotAvailable";
689 }
690 else if (entry == NodeAccessStatus::WriteOnly)
691 {
692 entryString = "WriteOnly";
693 }
694 else if (entry == NodeAccessStatus::ReadOnly)
695 {
696 entryString = "ReadOnly";
697 }
698 else if (entry == NodeAccessStatus::ReadWrite)
699 {
700 entryString = "ReadWrite";
701 }
702
703 return entryString;
704}
705
706inline std::string ToString(NodeCachingMode entry)
707{
708 std::string entryString;
709
710 if (entry == NodeCachingMode::NoCache)
711 {
712 entryString = "NoCache";
713 }
714 else if (entry == NodeCachingMode::WriteThrough)
715 {
716 entryString = "WriteThrough";
717 }
718 else if (entry == NodeCachingMode::WriteAround)
719 {
720 entryString = "WriteAround";
721 }
722
723 return entryString;
724}
725
726inline std::string ToString(NodeNamespace entry)
727{
728 std::string entryString;
729
730 if (entry == NodeNamespace::Custom)
731 {
732 entryString = "Custom";
733 }
734 else if (entry == NodeNamespace::Standard)
735 {
736 entryString = "Standard";
737 }
738
739 return entryString;
740}
741
742inline std::string ToString(NodeType entry)
743{
744 std::string entryString;
745
746 if (entry == NodeType::Integer)
747 {
748 entryString = "Integer";
749 }
750 else if (entry == NodeType::Boolean)
751 {
752 entryString = "Boolean";
753 }
754 else if (entry == NodeType::Command)
755 {
756 entryString = "Command";
757 }
758 else if (entry == NodeType::Float)
759 {
760 entryString = "Float";
761 }
762 else if (entry == NodeType::String)
763 {
764 entryString = "String";
765 }
766 else if (entry == NodeType::Register)
767 {
768 entryString = "Register";
769 }
770 else if (entry == NodeType::Category)
771 {
772 entryString = "Category";
773 }
774 else if (entry == NodeType::Enumeration)
775 {
776 entryString = "Enumeration";
777 }
778 else if (entry == NodeType::EnumerationEntry)
779 {
780 entryString = "EnumerationEntry";
781 }
782
783 return entryString;
784}
785
786inline std::string ToString(NodeVisibility entry)
787{
788 std::string entryString;
789
790 if (entry == NodeVisibility::Beginner)
791 {
792 entryString = "Beginner";
793 }
794 else if (entry == NodeVisibility::Expert)
795 {
796 entryString = "Expert";
797 }
798 else if (entry == NodeVisibility::Guru)
799 {
800 entryString = "Guru";
801 }
802 else if (entry == NodeVisibility::Invisible)
803 {
804 entryString = "Invisible";
805 }
806
807 return entryString;
808}
809
811inline Node::Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap)
812 : m_backendHandle(nodeHandle)
813 , m_parentNodeMap(parentNodeMap)
814 , m_changedCallbackManager()
815{
816 m_changedCallbackManager =
817 std::make_unique<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>(
818 [&](void* callbackContext) {
819 return QueryNumericFromCInterfaceFunction<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(
820 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE* nodeChangedCallbackHandle) {
822 m_backendHandle, ChangedCallbackCWrapper, callbackContext, nodeChangedCallbackHandle);
823 });
824 },
825 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE callbackHandle) {
826 CallAndCheckCInterfaceFunction([&] {
827 return PEAK_C_ABI_PREFIX PEAK_Node_UnregisterChangedCallback(m_backendHandle, callbackHandle);
828 });
829 });
830}
832
834{
835 m_changedCallbackManager->UnregisterAllCallbacks();
836}
837
838inline std::string Node::Name() const
839{
840 return GetNodeName(m_backendHandle);
841}
842
843inline std::string Node::DisplayName() const
844{
845 return QueryStringFromCInterfaceFunction([&](char* displayName, size_t* displayNameSize) {
846 return PEAK_C_ABI_PREFIX PEAK_Node_GetDisplayName(m_backendHandle, displayName, displayNameSize);
847 });
848}
849
851{
852 return static_cast<NodeNamespace>(
853 QueryNumericFromCInterfaceFunction<PEAK_NODE_NAMESPACE>([&](PEAK_NODE_NAMESPACE* _namespace) {
854 return PEAK_C_ABI_PREFIX PEAK_Node_GetNamespace(m_backendHandle, _namespace);
855 }));
856}
857
859{
860 return static_cast<NodeVisibility>(
861 QueryNumericFromCInterfaceFunction<PEAK_NODE_VISIBILITY>([&](PEAK_NODE_VISIBILITY* visibility) {
862 return PEAK_C_ABI_PREFIX PEAK_Node_GetVisibility(m_backendHandle, visibility);
863 }));
864}
865
867{
868 return static_cast<NodeAccessStatus>(
869 QueryNumericFromCInterfaceFunction<PEAK_NODE_ACCESS_STATUS>([&](PEAK_NODE_ACCESS_STATUS* accessStatus) {
870 return PEAK_C_ABI_PREFIX PEAK_Node_GetAccessStatus(m_backendHandle, accessStatus);
871 }));
872}
873
874inline bool Node::IsReadable() const
875{
876 const auto accessStatus = AccessStatus();
877 return accessStatus == NodeAccessStatus::ReadOnly || accessStatus == NodeAccessStatus::ReadWrite;
878}
879
880inline bool Node::IsWriteable() const
881{
882 const auto accessStatus = AccessStatus();
883 return accessStatus == NodeAccessStatus::WriteOnly || accessStatus == NodeAccessStatus::ReadWrite;
884}
885
886inline bool Node::IsAvailable() const
887{
888 const auto accessStatus = AccessStatus();
889 return accessStatus != NodeAccessStatus::NotImplemented && accessStatus != NodeAccessStatus::NotAvailable;
890}
891
892inline bool Node::IsImplemented() const
893{
894 const auto accessStatus = AccessStatus();
895 return accessStatus != NodeAccessStatus::NotImplemented;
896}
897
898
899inline bool Node::IsCacheable() const
900{
901 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isCacheable) {
902 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsCacheable(m_backendHandle, isCacheable);
903 }) > 0;
904}
905
907{
908 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessStatusCacheable) {
909 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsAccessStatusCacheable(m_backendHandle, isAccessStatusCacheable);
910 }) > 0;
911}
912
913inline bool Node::IsStreamable() const
914{
915 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isStreamable) {
916 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsStreamable(m_backendHandle, isStreamable);
917 }) > 0;
918}
919
920inline bool Node::IsDeprecated() const
921{
922 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isDeprecated) {
923 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsDeprecated(m_backendHandle, isDeprecated);
924 }) > 0;
925}
926
927inline bool Node::IsFeature() const
928{
929 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isFeature) {
930 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsFeature(m_backendHandle, isFeature);
931 }) > 0;
932}
933
935{
936 return static_cast<NodeCachingMode>(
937 QueryNumericFromCInterfaceFunction<PEAK_NODE_CACHING_MODE>([&](PEAK_NODE_CACHING_MODE* cachingMode) {
938 return PEAK_C_ABI_PREFIX PEAK_Node_GetCachingMode(m_backendHandle, cachingMode);
939 }));
940}
941
942inline int64_t Node::PollingTime() const
943{
944 return QueryNumericFromCInterfaceFunction<int64_t>([&](int64_t* pollingTime_ms) {
945 return PEAK_C_ABI_PREFIX PEAK_Node_GetPollingTime(m_backendHandle, pollingTime_ms);
946 });
947}
948
949inline std::string Node::ToolTip() const
950{
951 return QueryStringFromCInterfaceFunction([&](char* toolTip, size_t* toolTipSize) {
952 return PEAK_C_ABI_PREFIX PEAK_Node_GetToolTip(m_backendHandle, toolTip, toolTipSize);
953 });
954}
955
956inline std::string Node::Description() const
957{
958 return QueryStringFromCInterfaceFunction([&](char* description, size_t* descriptionSize) {
959 return PEAK_C_ABI_PREFIX PEAK_Node_GetDescription(m_backendHandle, description, descriptionSize);
960 });
961}
962
963inline NodeType Node::Type() const
964{
965 return static_cast<NodeType>(QueryNumericFromCInterfaceFunction<PEAK_NODE_TYPE>(
966 [&](PEAK_NODE_TYPE* type) { return PEAK_C_ABI_PREFIX PEAK_Node_GetType(m_backendHandle, type); }));
967}
968
969inline std::shared_ptr<peak::core::NodeMap> Node::ParentNodeMap() const
970{
971 return LockOrThrow(m_parentNodeMap);
972}
973
974inline std::shared_ptr<Node> Node::FindInvalidatedNode(const std::string& name) const
975{
976 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
978 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
979 });
980
981 auto nodeName = GetNodeName(nodeHandle);
982
983 return ParentNodeMap()->FindNode(name);
984}
985
986inline std::vector<std::shared_ptr<Node>> Node::InvalidatedNodes() const
987{
988 auto numInvalidatedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
989 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatedNodes(m_backendHandle, _numInvalidatedNodes);
990 });
991
992 std::vector<std::shared_ptr<Node>> invalidatedNodes;
993 for (size_t x = 0; x < numInvalidatedNodes; ++x)
994 {
995 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
996 [&](PEAK_NODE_HANDLE* _nodeHandle) {
997 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatedNode(m_backendHandle, x, _nodeHandle);
998 });
999
1000 auto nodeName = GetNodeName(nodeHandle);
1001
1002 invalidatedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1003 }
1004
1005 return invalidatedNodes;
1006}
1007
1008inline std::shared_ptr<Node> Node::FindInvalidatingNode(const std::string& name) const
1009{
1010 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1012 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1013 });
1014
1015 auto nodeName = GetNodeName(nodeHandle);
1016
1017 return ParentNodeMap()->FindNode(name);
1018}
1019
1020inline std::vector<std::shared_ptr<Node>> Node::InvalidatingNodes() const
1021{
1022 auto numInvalidatingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
1023 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatingNodes(m_backendHandle, _numInvalidatedNodes);
1024 });
1025
1026 std::vector<std::shared_ptr<Node>> invalidatingNodes;
1027 for (size_t x = 0; x < numInvalidatingNodes; ++x)
1028 {
1029 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1030 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1031 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatingNode(m_backendHandle, x, _nodeHandle);
1032 });
1033
1034 auto nodeName = GetNodeName(nodeHandle);
1035
1036 invalidatingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1037 }
1038
1039 return invalidatingNodes;
1040}
1041
1042inline std::shared_ptr<Node> Node::FindSelectedNode(const std::string& name) const
1043{
1044 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1046 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1047 });
1048
1049 auto nodeName = GetNodeName(nodeHandle);
1050
1051 return ParentNodeMap()->FindNode(name);
1052}
1053
1054inline std::vector<std::shared_ptr<Node>> Node::SelectedNodes() const
1055{
1056 auto numSelectedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectedNodes) {
1057 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectedNodes(m_backendHandle, _numSelectedNodes);
1058 });
1059
1060 std::vector<std::shared_ptr<Node>> selectedNodes;
1061 for (size_t x = 0; x < numSelectedNodes; ++x)
1062 {
1063 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1064 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1065 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectedNode(m_backendHandle, x, _nodeHandle);
1066 });
1067
1068 auto nodeName = GetNodeName(nodeHandle);
1069
1070 selectedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1071 }
1072
1073 return selectedNodes;
1074}
1075
1076inline std::shared_ptr<Node> Node::FindSelectingNode(const std::string& name) const
1077{
1078 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1080 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1081 });
1082
1083 auto nodeName = GetNodeName(nodeHandle);
1084
1085 return ParentNodeMap()->FindNode(name);
1086}
1087
1088inline std::vector<std::shared_ptr<Node>> Node::SelectingNodes() const
1089{
1090 auto numSelectingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectingNodes) {
1091 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectingNodes(m_backendHandle, _numSelectingNodes);
1092 });
1093
1094 std::vector<std::shared_ptr<Node>> selectingNodes;
1095 for (size_t x = 0; x < numSelectingNodes; ++x)
1096 {
1097 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1098 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1099 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectingNode(m_backendHandle, x, _nodeHandle);
1100 });
1101
1102 auto nodeName = GetNodeName(nodeHandle);
1103
1104 selectingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1105 }
1106
1107 return selectingNodes;
1108}
1109
1111{
1112 return reinterpret_cast<ChangedCallbackHandle>(
1113 m_changedCallbackManager->RegisterCallback(NodeChangedCallbackContainer{ shared_from_this(), callback }));
1114}
1115
1117{
1118 m_changedCallbackManager->UnregisterCallback(
1119 reinterpret_cast<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(callbackHandle));
1120}
1121
1122inline void PEAK_CALL_CONV Node::ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context)
1123{
1124 auto callbackContainer = static_cast<NodeChangedCallbackContainer*>(context);
1125
1126 callbackContainer->Callback(callbackContainer->_Node);
1127}
1128
1129} /* namespace nodes */
1130} /* namespace core */
1131} /* namespace peak */
The exception thrown for trying to apply an invalid cast.
Definition peak_exception.hpp:146
Represents a GenAPI node map.
Definition peak_node_map.hpp:60
PEAK_COMMON_NO_DISCARD NodeType Type() const
Returns the type.
Definition peak_node.hpp:963
PEAK_COMMON_NO_DISCARD ChangedCallbackHandle RegisterChangedCallback(const ChangedCallback &callback)
Registers a callback for signaling a change to the node.
Definition peak_node.hpp:1110
std::function< void(const std::shared_ptr< Node > &changedNode)> ChangedCallback
Definition peak_node.hpp:128
PEAK_COMMON_NO_DISCARD bool IsFeature() const
Checks whether the node is a feature, i.e. it can be reached via category nodes from a category node ...
Definition peak_node.hpp:927
PEAK_COMMON_NO_DISCARD std::shared_ptr< NodeType > FindSelectedNode(const std::string &name) const
Tries to find a selected node with the given name and type.
Definition peak_node.hpp:533
PEAK_COMMON_NO_DISCARD bool IsDeprecated() const
Checks whether the node is deprecated.
Definition peak_node.hpp:920
PEAK_COMMON_NO_DISCARD std::string ToolTip() const
Returns the tool tip.
Definition peak_node.hpp:949
PEAK_COMMON_NO_DISCARD std::vector< std::shared_ptr< Node > > SelectedNodes() const
Returns the selected nodes.
Definition peak_node.hpp:1054
PEAK_COMMON_NO_DISCARD std::string DisplayName() const
Returns the display name.
Definition peak_node.hpp:843
Node & operator=(const Node &other)=delete
PEAK_COMMON_NO_DISCARD NodeNamespace Namespace() const
Returns the namespace the node belongs to.
Definition peak_node.hpp:850
Node & operator=(Node &&other)=delete
PEAK_COMMON_NO_DISCARD bool IsWriteable() const
Returns whether the node is currently writeable.
Definition peak_node.hpp:880
PEAK_COMMON_NO_DISCARD std::shared_ptr< Node > FindSelectingNode(const std::string &name) const
Tries to find a selecting node with the given name.
Definition peak_node.hpp:1076
PEAK_COMMON_NO_DISCARD std::shared_ptr< NodeMap > ParentNodeMap() const
Returns the parent node map.
Definition peak_node.hpp:969
PEAK_COMMON_NO_DISCARD std::string Name() const
Returns the name.
Definition peak_node.hpp:838
PEAK_COMMON_NO_DISCARD std::shared_ptr< NodeType > FindInvalidatingNode(const std::string &name) const
Tries to find an invalidating node with the given name and type.
Definition peak_node.hpp:476
PEAK_COMMON_NO_DISCARD int64_t PollingTime() const
Returns the polling time.
Definition peak_node.hpp:942
PEAK_COMMON_NO_DISCARD std::shared_ptr< Node > FindInvalidatingNode(const std::string &name) const
Tries to find an invalidating node with the given name.
Definition peak_node.hpp:1008
PEAK_COMMON_NO_DISCARD std::vector< std::shared_ptr< Node > > InvalidatingNodes() const
Returns the invalidating nodes.
Definition peak_node.hpp:1020
virtual ~Node()
Definition peak_node.hpp:833
PEAK_COMMON_NO_DISCARD NodeVisibility Visibility() const
Returns the visibility.
Definition peak_node.hpp:858
PEAK_COMMON_NO_DISCARD bool IsAccessStatusCacheable() const
Checks whether the node's access status is cacheable.
Definition peak_node.hpp:906
PEAK_COMMON_NO_DISCARD bool IsReadable() const
Returns whether the node is currently readable.
Definition peak_node.hpp:874
PEAK_COMMON_NO_DISCARD std::shared_ptr< Node > FindSelectedNode(const std::string &name) const
Tries to find a selected node with the given name.
Definition peak_node.hpp:1042
PEAK_COMMON_NO_DISCARD std::vector< std::shared_ptr< Node > > InvalidatedNodes() const
Returns the invalidated nodes.
Definition peak_node.hpp:986
PEAK_COMMON_NO_DISCARD std::vector< std::shared_ptr< Node > > SelectingNodes() const
Returns the selecting nodes.
Definition peak_node.hpp:1088
PEAK_COMMON_NO_DISCARD std::shared_ptr< NodeType > FindInvalidatedNode(const std::string &name) const
Tries to find an invalidated node with the given name and type.
Definition peak_node.hpp:411
PEAK_COMMON_NO_DISCARD bool IsCacheable() const
Checks whether the node is cacheable.
Definition peak_node.hpp:899
PEAK_COMMON_NO_DISCARD std::shared_ptr< NodeType > FindSelectingNode(const std::string &name) const
Tries to find a selecting node with the given name and type.
Definition peak_node.hpp:585
PEAK_COMMON_NO_DISCARD std::string Description() const
Returns the description.
Definition peak_node.hpp:956
PEAK_COMMON_NO_DISCARD bool IsStreamable() const
Checks whether the node is streamable.
Definition peak_node.hpp:913
Node(Node &&other)=delete
PEAK_COMMON_NO_DISCARD bool IsImplemented() const
Returns whether the node is implemented.
Definition peak_node.hpp:892
PEAK_COMMON_NO_DISCARD bool IsAvailable() const
Returns whether the node is currently either readable or writeable.
Definition peak_node.hpp:886
PEAK_COMMON_NO_DISCARD NodeCachingMode CachingMode() const
Returns the caching mode.
Definition peak_node.hpp:934
PEAK_COMMON_NO_DISCARD std::shared_ptr< Node > FindInvalidatedNode(const std::string &name) const
Tries to find an invalidated node with the given name.
Definition peak_node.hpp:974
ChangedCallback * ChangedCallbackHandle
Definition peak_node.hpp:130
PEAK_COMMON_NO_DISCARD NodeAccessStatus AccessStatus() const
Returns the access status.
Definition peak_node.hpp:866
void UnregisterChangedCallback(ChangedCallbackHandle callbackHandle)
Unregisters a changed callback.
Definition peak_node.hpp:1116
Node(const Node &other)=delete
@ AccessStatus
Definition peak_device_descriptor.hpp:58
NodeVisibility
Definition peak_node.hpp:105
NodeType
Definition peak_node.hpp:88
NodeNamespace
Definition peak_node.hpp:78
NodeCachingMode
Definition peak_node.hpp:57
NodeAccessStatus
Definition peak_node.hpp:43
@ Expert
Definition peak_node.hpp:107
@ Beginner
Definition peak_node.hpp:106
@ Guru
Definition peak_node.hpp:108
@ Invisible
Definition peak_node.hpp:109
@ Register
Definition peak_node.hpp:94
@ Float
Definition peak_node.hpp:92
@ String
Definition peak_node.hpp:93
@ Boolean
Definition peak_node.hpp:90
@ Enumeration
Definition peak_node.hpp:96
@ Category
Definition peak_node.hpp:95
@ Integer
Definition peak_node.hpp:89
@ EnumerationEntry
Definition peak_node.hpp:97
@ Command
Definition peak_node.hpp:91
@ Custom
Definition peak_node.hpp:79
@ Standard
Definition peak_node.hpp:80
@ NoCache
Definition peak_node.hpp:61
@ WriteAround
Definition peak_node.hpp:69
@ WriteThrough
Definition peak_node.hpp:65
@ ReadOnly
Definition peak_node.hpp:47
@ NotAvailable
Definition peak_node.hpp:45
@ WriteOnly
Definition peak_node.hpp:46
@ ReadWrite
Definition peak_node.hpp:48
@ NotImplemented
Definition peak_node.hpp:44
@ Boolean
Definition peak_common_node_enums.hpp:62
The "nodes" namespace contains all GenAPI node types.
Definition peak_utils.hpp:31
PEAK_COMMON_NO_DISCARD std::string ToString(NodeCacheUsePolicy entry)
Definition peak_common_node_enums.hpp:69
std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
Definition peak_node.hpp:657
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:32
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_buffer.hpp:29
PEAK_C_API PEAK_Node_GetIsFeature(PEAK_NODE_HANDLE nodeHandle, PEAK_BOOL8 *isFeature)
Asks the given node whether it is a feature, i.e. it can be reached via category nodes from a categor...
PEAK_C_API PEAK_Node_FindSelectedNode(PEAK_NODE_HANDLE nodeHandle, const char *name, size_t nameSize, PEAK_NODE_HANDLE *selectedNodeHandle)
Tells the given node to find a selected node with the given name.
PEAK_C_API PEAK_Node_GetToolTip(PEAK_NODE_HANDLE nodeHandle, char *toolTip, size_t *toolTipSize)
Asks the given node for its tooltip.
PEAK_C_API PEAK_Node_GetCachingMode(PEAK_NODE_HANDLE nodeHandle, PEAK_NODE_CACHING_MODE *cachingMode)
Asks the given node for its caching mode.
PEAK_NODE_CHANGED_CALLBACK * PEAK_NODE_CHANGED_CALLBACK_HANDLE
Definition peak_backend.h:580
PEAK_C_API PEAK_Node_GetNumSelectedNodes(PEAK_NODE_HANDLE nodeHandle, size_t *numSelectedNodes)
Asks the given node for its number of selected nodes.
PEAK_C_API PEAK_Node_FindSelectingNode(PEAK_NODE_HANDLE nodeHandle, const char *name, size_t nameSize, PEAK_NODE_HANDLE *selectingNodeHandle)
Tells the given node to find a selecting node with the given name.
struct PEAK_NODE * PEAK_NODE_HANDLE
Definition peak_backend.h:427
PEAK_C_API PEAK_Node_GetInvalidatingNode(PEAK_NODE_HANDLE nodeHandle, size_t index, PEAK_NODE_HANDLE *invalidatingNodeHandle)
Asks the given node for the invalidating node with the given index.
PEAK_C_API PEAK_Node_GetNumSelectingNodes(PEAK_NODE_HANDLE nodeHandle, size_t *numSelectingNodes)
Asks the given node for its number of selecting nodes.
PEAK_C_API PEAK_Node_GetSelectingNode(PEAK_NODE_HANDLE nodeHandle, size_t index, PEAK_NODE_HANDLE *selectingNodeHandle)
Asks the given node for the selecting node with the given index.
PEAK_C_API PEAK_Node_GetType(PEAK_NODE_HANDLE nodeHandle, PEAK_NODE_TYPE *type)
Asks the given node for its type.
int32_t PEAK_NODE_ACCESS_STATUS
Definition peak_backend.h:223
int32_t PEAK_NODE_TYPE
Definition peak_backend.h:294
PEAK_C_API PEAK_Node_FindInvalidatedNode(PEAK_NODE_HANDLE nodeHandle, const char *name, size_t nameSize, PEAK_NODE_HANDLE *invalidatedNodeHandle)
Tells the given node to find an invalidated node with the given name.
PEAK_C_API PEAK_Node_FindInvalidatingNode(PEAK_NODE_HANDLE nodeHandle, const char *name, size_t nameSize, PEAK_NODE_HANDLE *invalidatingNodeHandle)
Tells the given node to find an invalidating node with the given name.
PEAK_C_API PEAK_Node_GetVisibility(PEAK_NODE_HANDLE nodeHandle, PEAK_NODE_VISIBILITY *visibility)
Asks the given node for its visibility.
PEAK_C_API PEAK_Node_RegisterChangedCallback(PEAK_NODE_HANDLE nodeHandle, PEAK_NODE_CHANGED_CALLBACK callback, void *callbackContext, PEAK_NODE_CHANGED_CALLBACK_HANDLE *callbackHandle)
Registers a callback signaling a change at the given node.
PEAK_C_API PEAK_Node_GetName(PEAK_NODE_HANDLE nodeHandle, char *name, size_t *nameSize)
Asks the given node for its name.
PEAK_C_API PEAK_Node_GetNamespace(PEAK_NODE_HANDLE nodeHandle, PEAK_NODE_NAMESPACE *_namespace)
Asks the given node for its namespace.
PEAK_C_API PEAK_Node_GetSelectedNode(PEAK_NODE_HANDLE nodeHandle, size_t index, PEAK_NODE_HANDLE *selectedNodeHandle)
Asks the given node for the selected node with the given index.
PEAK_C_API PEAK_Node_GetDescription(PEAK_NODE_HANDLE nodeHandle, char *description, size_t *descriptionSize)
Asks the given node for its description.
PEAK_C_API PEAK_Node_GetNumInvalidatingNodes(PEAK_NODE_HANDLE nodeHandle, size_t *numInvalidatingNodes)
Asks the given node for its number of invalidating nodes.
int8_t PEAK_BOOL8
Definition peak_backend.h:41
int32_t PEAK_NODE_CACHING_MODE
Definition peak_backend.h:232
PEAK_C_API PEAK_Node_GetNumInvalidatedNodes(PEAK_NODE_HANDLE nodeHandle, size_t *numInvalidatedNodes)
Asks the given node for its number of invalidated nodes.
PEAK_C_API PEAK_Node_GetIsDeprecated(PEAK_NODE_HANDLE nodeHandle, PEAK_BOOL8 *isDeprecated)
Asks the given node whether it is deprecated.
PEAK_C_API PEAK_Node_GetIsStreamable(PEAK_NODE_HANDLE nodeHandle, PEAK_BOOL8 *isStreamable)
Asks the given node whether it is streamable.
PEAK_C_API PEAK_Node_GetAccessStatus(PEAK_NODE_HANDLE nodeHandle, PEAK_NODE_ACCESS_STATUS *accessStatus)
Asks the given node for its access status.
PEAK_C_API PEAK_Node_GetIsCacheable(PEAK_NODE_HANDLE nodeHandle, PEAK_BOOL8 *isCacheable)
Asks the given node whether it is cacheable.
int32_t PEAK_NODE_NAMESPACE
Definition peak_backend.h:266
PEAK_C_API PEAK_Node_GetDisplayName(PEAK_NODE_HANDLE nodeHandle, char *displayName, size_t *displayNameSize)
Asks the given node for its display name.
PEAK_C_API PEAK_Node_GetPollingTime(PEAK_NODE_HANDLE nodeHandle, int64_t *pollingTime_ms)
Asks the given node for its polling time.
PEAK_C_API PEAK_Node_GetInvalidatedNode(PEAK_NODE_HANDLE nodeHandle, size_t index, PEAK_NODE_HANDLE *invalidatedNodeHandle)
Asks the given node for the invalidated node with the given index.
PEAK_C_API PEAK_Node_GetIsAccessStatusCacheable(PEAK_NODE_HANDLE nodeHandle, PEAK_BOOL8 *isAccessStatusCacheable)
Asks the given node whether its access status is cacheable.
int32_t PEAK_NODE_VISIBILITY
Definition peak_backend.h:304
PEAK_C_API PEAK_Node_UnregisterChangedCallback(PEAK_NODE_HANDLE nodeHandle, PEAK_NODE_CHANGED_CALLBACK_HANDLE callbackHandle)
Unregisters the changed callback with the given handle from the given node.
#define PEAK_COMMON_NO_DISCARD
Definition peak_common_defines.h:89
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:13