IDS peak genericC++ v1.16.0
Loading...
Searching...
No Matches
peak_node.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13
15#include <peak/dll_interface/peak_dll_interface_util.hpp>
16#include <peak/generic/peak_t_callback_manager.hpp>
17
18#include <type_traits>
19#include <cstddef>
20#include <cstdint>
21#include <functional>
22#include <memory>
23#include <string>
24#include <vector>
25
26
27namespace peak
28{
29namespace core
30{
31
32class NodeMap;
33
37namespace nodes
38{
39
53
74
80enum class NodeNamespace
81{
84};
85
102
114
116struct NodeChangedCallbackContainer;
118
127class Node : public std::enable_shared_from_this<Node>
128{
129public:
131 using ChangedCallback = std::function<void(const std::shared_ptr<Node>& changedNode)>;
134
135 Node() = delete;
136 virtual ~Node();
137 Node(const Node& other) = delete;
138 Node& operator=(const Node& other) = delete;
139 Node(Node&& other) = delete;
140 Node& operator=(Node&& other) = delete;
141
151 std::string Name() const;
152
162 std::string DisplayName() const;
163
173 NodeNamespace Namespace() const;
174
185
197
206 bool IsReadable() const;
207
216 bool IsWriteable() const;
217
226 bool IsAvailable() const;
227
236 bool IsImplemented() const;
237
250 bool IsCacheable() const;
251
264 bool IsAccessStatusCacheable() const;
265
276 bool IsStreamable() const;
277
288 bool IsDeprecated() const;
289
301 bool IsFeature() const;
302
315
327 int64_t PollingTime() const;
328
338 std::string ToolTip() const;
339
349 std::string Description() const;
350
363 NodeType Type() const;
364
374 std::shared_ptr<NodeMap> ParentNodeMap() const;
375
394 std::shared_ptr<Node> FindInvalidatedNode(const std::string& name) const;
395
413 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
414 std::shared_ptr<NodeType> FindInvalidatedNode(const std::string& name) const
415 {
416 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatedNode(name));
417 if (!castedNode)
418 {
419 throw InvalidCastException("Invalid node cast!");
420 }
421
422 return castedNode;
423 }
424
439 std::vector<std::shared_ptr<Node>> InvalidatedNodes() const;
440
459 std::shared_ptr<Node> FindInvalidatingNode(const std::string& name) const;
460
478 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
479 std::shared_ptr<NodeType> FindInvalidatingNode(const std::string& name) const
480 {
481 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatingNode(name));
482 if (!castedNode)
483 {
484 throw InvalidCastException("Invalid node cast!");
485 }
486
487 return castedNode;
488 }
489
504 std::vector<std::shared_ptr<Node>> InvalidatingNodes() const;
505
519 std::shared_ptr<Node> FindSelectedNode(const std::string& name) const;
520
535 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
536 std::shared_ptr<NodeType> FindSelectedNode(const std::string& name) const
537 {
538 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectedNode(name));
539 if (!castedNode)
540 {
541 throw InvalidCastException("Invalid node cast!");
542 }
543
544 return castedNode;
545 }
546
556 std::vector<std::shared_ptr<Node>> SelectedNodes() const;
557
571 std::shared_ptr<Node> FindSelectingNode(const std::string& name) const;
572
587 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
588 std::shared_ptr<NodeType> FindSelectingNode(const std::string& name) const
589 {
590 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectingNode(name));
591 if (!castedNode)
592 {
593 throw InvalidCastException("Invalid node cast!");
594 }
595
596 return castedNode;
597 }
598
608 std::vector<std::shared_ptr<Node>> SelectingNodes() const;
609
625
638
639protected:
641 Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap);
643private:
644 struct NodeChangedCallbackContainer
645 {
646 std::shared_ptr<Node> _Node;
647 Node::ChangedCallback Callback;
648 };
649 static void PEAK_CALL_CONV ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context);
650
651 friend ClassCreator<Node>;
652 PEAK_NODE_HANDLE m_backendHandle;
653
654 std::weak_ptr<NodeMap> m_parentNodeMap;
655
656 std::unique_ptr<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>
657 m_changedCallbackManager;
658};
659
660inline std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
661{
662 return QueryStringFromCInterfaceFunction([&](char* nodeName, size_t* nodeNameSize) {
663 return PEAK_C_ABI_PREFIX PEAK_Node_GetName(nodeHandle, nodeName, nodeNameSize);
664 });
665}
666
667} /* namespace nodes */
668} /* namespace core */
669} /* namespace peak */
670
672
673/* Implementation */
674namespace peak
675{
676namespace core
677{
678namespace nodes
679{
680
681inline std::string ToString(NodeAccessStatus entry)
682{
683 std::string entryString;
684
686 {
687 entryString = "NotImplemented";
688 }
689 else if (entry == NodeAccessStatus::NotAvailable)
690 {
691 entryString = "NotAvailable";
692 }
693 else if (entry == NodeAccessStatus::WriteOnly)
694 {
695 entryString = "WriteOnly";
696 }
697 else if (entry == NodeAccessStatus::ReadOnly)
698 {
699 entryString = "ReadOnly";
700 }
701 else if (entry == NodeAccessStatus::ReadWrite)
702 {
703 entryString = "ReadWrite";
704 }
705
706 return entryString;
707}
708
709inline std::string ToString(NodeCachingMode entry)
710{
711 std::string entryString;
712
713 if (entry == NodeCachingMode::NoCache)
714 {
715 entryString = "NoCache";
716 }
717 else if (entry == NodeCachingMode::WriteThrough)
718 {
719 entryString = "WriteThrough";
720 }
721 else if (entry == NodeCachingMode::WriteAround)
722 {
723 entryString = "WriteAround";
724 }
725
726 return entryString;
727}
728
729inline std::string ToString(NodeNamespace entry)
730{
731 std::string entryString;
732
733 if (entry == NodeNamespace::Custom)
734 {
735 entryString = "Custom";
736 }
737 else if (entry == NodeNamespace::Standard)
738 {
739 entryString = "Standard";
740 }
741
742 return entryString;
743}
744
745inline std::string ToString(NodeType entry)
746{
747 std::string entryString;
748
749 if (entry == NodeType::Integer)
750 {
751 entryString = "Integer";
752 }
753 else if (entry == NodeType::Boolean)
754 {
755 entryString = "Boolean";
756 }
757 else if (entry == NodeType::Command)
758 {
759 entryString = "Command";
760 }
761 else if (entry == NodeType::Float)
762 {
763 entryString = "Float";
764 }
765 else if (entry == NodeType::String)
766 {
767 entryString = "String";
768 }
769 else if (entry == NodeType::Register)
770 {
771 entryString = "Register";
772 }
773 else if (entry == NodeType::Category)
774 {
775 entryString = "Category";
776 }
777 else if (entry == NodeType::Enumeration)
778 {
779 entryString = "Enumeration";
780 }
781 else if (entry == NodeType::EnumerationEntry)
782 {
783 entryString = "EnumerationEntry";
784 }
785
786 return entryString;
787}
788
789inline std::string ToString(NodeVisibility entry)
790{
791 std::string entryString;
792
793 if (entry == NodeVisibility::Beginner)
794 {
795 entryString = "Beginner";
796 }
797 else if (entry == NodeVisibility::Expert)
798 {
799 entryString = "Expert";
800 }
801 else if (entry == NodeVisibility::Guru)
802 {
803 entryString = "Guru";
804 }
805 else if (entry == NodeVisibility::Invisible)
806 {
807 entryString = "Invisible";
808 }
809
810 return entryString;
811}
812
814inline Node::Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap)
815 : m_backendHandle(nodeHandle)
816 , m_parentNodeMap(parentNodeMap)
817 , m_changedCallbackManager()
818{
819 m_changedCallbackManager =
820 std::make_unique<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>(
821 [&](void* callbackContext) {
822 return QueryNumericFromCInterfaceFunction<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(
823 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE* nodeChangedCallbackHandle) {
825 m_backendHandle, ChangedCallbackCWrapper, callbackContext, nodeChangedCallbackHandle);
826 });
827 },
828 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE callbackHandle) {
829 CallAndCheckCInterfaceFunction([&] {
830 return PEAK_C_ABI_PREFIX PEAK_Node_UnregisterChangedCallback(m_backendHandle, callbackHandle);
831 });
832 });
833}
835
837{
838 m_changedCallbackManager->UnregisterAllCallbacks();
839}
840
841inline std::string Node::Name() const
842{
843 return GetNodeName(m_backendHandle);
844}
845
846inline std::string Node::DisplayName() const
847{
848 return QueryStringFromCInterfaceFunction([&](char* displayName, size_t* displayNameSize) {
849 return PEAK_C_ABI_PREFIX PEAK_Node_GetDisplayName(m_backendHandle, displayName, displayNameSize);
850 });
851}
852
854{
855 return static_cast<NodeNamespace>(
856 QueryNumericFromCInterfaceFunction<PEAK_NODE_NAMESPACE>([&](PEAK_NODE_NAMESPACE* _namespace) {
857 return PEAK_C_ABI_PREFIX PEAK_Node_GetNamespace(m_backendHandle, _namespace);
858 }));
859}
860
862{
863 return static_cast<NodeVisibility>(
864 QueryNumericFromCInterfaceFunction<PEAK_NODE_VISIBILITY>([&](PEAK_NODE_VISIBILITY* visibility) {
865 return PEAK_C_ABI_PREFIX PEAK_Node_GetVisibility(m_backendHandle, visibility);
866 }));
867}
868
870{
871 return static_cast<NodeAccessStatus>(
872 QueryNumericFromCInterfaceFunction<PEAK_NODE_ACCESS_STATUS>([&](PEAK_NODE_ACCESS_STATUS* accessStatus) {
873 return PEAK_C_ABI_PREFIX PEAK_Node_GetAccessStatus(m_backendHandle, accessStatus);
874 }));
875}
876
877inline bool Node::IsReadable() const
878{
879 const auto accessStatus = AccessStatus();
880 return accessStatus == NodeAccessStatus::ReadOnly || accessStatus == NodeAccessStatus::ReadWrite;
881}
882
883inline bool Node::IsWriteable() const
884{
885 const auto accessStatus = AccessStatus();
886 return accessStatus == NodeAccessStatus::WriteOnly || accessStatus == NodeAccessStatus::ReadWrite;
887}
888
889inline bool Node::IsAvailable() const
890{
891 const auto accessStatus = AccessStatus();
892 return accessStatus != NodeAccessStatus::NotImplemented && accessStatus != NodeAccessStatus::NotAvailable;
893}
894
895inline bool Node::IsImplemented() const
896{
897 const auto accessStatus = AccessStatus();
898 return accessStatus != NodeAccessStatus::NotImplemented;
899}
900
901
902
903inline bool Node::IsCacheable() const
904{
905 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isCacheable) {
906 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsCacheable(m_backendHandle, isCacheable);
907 }) > 0;
908}
909
911{
912 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessStatusCacheable) {
913 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsAccessStatusCacheable(m_backendHandle, isAccessStatusCacheable);
914 }) > 0;
915}
916
917inline bool Node::IsStreamable() const
918{
919 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isStreamable) {
920 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsStreamable(m_backendHandle, isStreamable);
921 }) > 0;
922}
923
924inline bool Node::IsDeprecated() const
925{
926 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isDeprecated) {
927 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsDeprecated(m_backendHandle, isDeprecated);
928 }) > 0;
929}
930
931inline bool Node::IsFeature() const
932{
933 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isFeature) {
934 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsFeature(m_backendHandle, isFeature);
935 }) > 0;
936}
937
939{
940 return static_cast<NodeCachingMode>(
941 QueryNumericFromCInterfaceFunction<PEAK_NODE_CACHING_MODE>([&](PEAK_NODE_CACHING_MODE* cachingMode) {
942 return PEAK_C_ABI_PREFIX PEAK_Node_GetCachingMode(m_backendHandle, cachingMode);
943 }));
944}
945
946inline int64_t Node::PollingTime() const
947{
948 return QueryNumericFromCInterfaceFunction<int64_t>([&](int64_t* pollingTime_ms) {
949 return PEAK_C_ABI_PREFIX PEAK_Node_GetPollingTime(m_backendHandle, pollingTime_ms);
950 });
951}
952
953inline std::string Node::ToolTip() const
954{
955 return QueryStringFromCInterfaceFunction([&](char* toolTip, size_t* toolTipSize) {
956 return PEAK_C_ABI_PREFIX PEAK_Node_GetToolTip(m_backendHandle, toolTip, toolTipSize);
957 });
958}
959
960inline std::string Node::Description() const
961{
962 return QueryStringFromCInterfaceFunction([&](char* description, size_t* descriptionSize) {
963 return PEAK_C_ABI_PREFIX PEAK_Node_GetDescription(m_backendHandle, description, descriptionSize);
964 });
965}
966
967inline NodeType Node::Type() const
968{
969 return static_cast<NodeType>(QueryNumericFromCInterfaceFunction<PEAK_NODE_TYPE>(
970 [&](PEAK_NODE_TYPE* type) { return PEAK_C_ABI_PREFIX PEAK_Node_GetType(m_backendHandle, type); }));
971}
972
973inline std::shared_ptr<peak::core::NodeMap> Node::ParentNodeMap() const
974{
975 return LockOrThrow(m_parentNodeMap);
976}
977
978inline std::shared_ptr<Node> Node::FindInvalidatedNode(const std::string& name) const
979{
980 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
982 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
983 });
984
985 auto nodeName = GetNodeName(nodeHandle);
986
987 return ParentNodeMap()->FindNode(name);
988}
989
990inline std::vector<std::shared_ptr<Node>> Node::InvalidatedNodes() const
991{
992 auto numInvalidatedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
993 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatedNodes(m_backendHandle, _numInvalidatedNodes);
994 });
995
996 std::vector<std::shared_ptr<Node>> invalidatedNodes;
997 for (size_t x = 0; x < numInvalidatedNodes; ++x)
998 {
999 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1000 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1001 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatedNode(m_backendHandle, x, _nodeHandle);
1002 });
1003
1004 auto nodeName = GetNodeName(nodeHandle);
1005
1006 invalidatedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1007 }
1008
1009 return invalidatedNodes;
1010}
1011
1012inline std::shared_ptr<Node> Node::FindInvalidatingNode(const std::string& name) const
1013{
1014 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1016 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1017 });
1018
1019 auto nodeName = GetNodeName(nodeHandle);
1020
1021 return ParentNodeMap()->FindNode(name);
1022}
1023
1024inline std::vector<std::shared_ptr<Node>> Node::InvalidatingNodes() const
1025{
1026 auto numInvalidatingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
1027 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatingNodes(m_backendHandle, _numInvalidatedNodes);
1028 });
1029
1030 std::vector<std::shared_ptr<Node>> invalidatingNodes;
1031 for (size_t x = 0; x < numInvalidatingNodes; ++x)
1032 {
1033 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1034 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1035 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatingNode(m_backendHandle, x, _nodeHandle);
1036 });
1037
1038 auto nodeName = GetNodeName(nodeHandle);
1039
1040 invalidatingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1041 }
1042
1043 return invalidatingNodes;
1044}
1045
1046inline std::shared_ptr<Node> Node::FindSelectedNode(const std::string& name) const
1047{
1048 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1050 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1051 });
1052
1053 auto nodeName = GetNodeName(nodeHandle);
1054
1055 return ParentNodeMap()->FindNode(name);
1056}
1057
1058inline std::vector<std::shared_ptr<Node>> Node::SelectedNodes() const
1059{
1060 auto numSelectedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectedNodes) {
1061 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectedNodes(m_backendHandle, _numSelectedNodes);
1062 });
1063
1064 std::vector<std::shared_ptr<Node>> selectedNodes;
1065 for (size_t x = 0; x < numSelectedNodes; ++x)
1066 {
1067 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1068 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1069 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectedNode(m_backendHandle, x, _nodeHandle);
1070 });
1071
1072 auto nodeName = GetNodeName(nodeHandle);
1073
1074 selectedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1075 }
1076
1077 return selectedNodes;
1078}
1079
1080inline std::shared_ptr<Node> Node::FindSelectingNode(const std::string& name) const
1081{
1082 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1084 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1085 });
1086
1087 auto nodeName = GetNodeName(nodeHandle);
1088
1089 return ParentNodeMap()->FindNode(name);
1090}
1091
1092inline std::vector<std::shared_ptr<Node>> Node::SelectingNodes() const
1093{
1094 auto numSelectingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectingNodes) {
1095 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectingNodes(m_backendHandle, _numSelectingNodes);
1096 });
1097
1098 std::vector<std::shared_ptr<Node>> selectingNodes;
1099 for (size_t x = 0; x < numSelectingNodes; ++x)
1100 {
1101 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1102 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1103 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectingNode(m_backendHandle, x, _nodeHandle);
1104 });
1105
1106 auto nodeName = GetNodeName(nodeHandle);
1107
1108 selectingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1109 }
1110
1111 return selectingNodes;
1112}
1113
1115{
1116 return reinterpret_cast<ChangedCallbackHandle>(
1117 m_changedCallbackManager->RegisterCallback(NodeChangedCallbackContainer{ shared_from_this(), callback }));
1118}
1119
1121{
1122 m_changedCallbackManager->UnregisterCallback(
1123 reinterpret_cast<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(callbackHandle));
1124}
1125
1126inline void PEAK_CALL_CONV Node::ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context)
1127{
1128 auto callbackContainer = static_cast<NodeChangedCallbackContainer*>(context);
1129
1130 callbackContainer->Callback(callbackContainer->_Node);
1131}
1132
1133} /* namespace nodes */
1134} /* namespace core */
1135} /* namespace peak */
The exception thrown for trying to apply an invalid cast.
Definition peak_exception.hpp:142
Represents a GenAPI node map.
Definition peak_node_map.hpp:63
NodeType Type() const
Returns the type.
Definition peak_node.hpp:967
ChangedCallbackHandle RegisterChangedCallback(const ChangedCallback &callback)
Registers a callback for signaling a change to the node.
Definition peak_node.hpp:1114
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:588
std::function< void(const std::shared_ptr< Node > &changedNode)> ChangedCallback
Definition peak_node.hpp:131
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:931
bool IsDeprecated() const
Checks whether the node is deprecated.
Definition peak_node.hpp:924
std::string ToolTip() const
Returns the tool tip.
Definition peak_node.hpp:953
std::vector< std::shared_ptr< Node > > SelectedNodes() const
Returns the selected nodes.
Definition peak_node.hpp:1058
std::string DisplayName() const
Returns the display name.
Definition peak_node.hpp:846
Node & operator=(const Node &other)=delete
NodeNamespace Namespace() const
Returns the namespace the node belongs to.
Definition peak_node.hpp:853
Node & operator=(Node &&other)=delete
bool IsWriteable() const
Returns whether the node is currently writeable.
Definition peak_node.hpp:883
std::shared_ptr< Node > FindSelectingNode(const std::string &name) const
Tries to find a selecting node with the given name.
Definition peak_node.hpp:1080
std::shared_ptr< NodeMap > ParentNodeMap() const
Returns the parent node map.
Definition peak_node.hpp:973
std::string Name() const
Returns the name.
Definition peak_node.hpp:841
int64_t PollingTime() const
Returns the polling time.
Definition peak_node.hpp:946
std::shared_ptr< Node > FindInvalidatingNode(const std::string &name) const
Tries to find an invalidating node with the given name.
Definition peak_node.hpp:1012
std::vector< std::shared_ptr< Node > > InvalidatingNodes() const
Returns the invalidating nodes.
Definition peak_node.hpp:1024
virtual ~Node()
Definition peak_node.hpp:836
NodeVisibility Visibility() const
Returns the visibility.
Definition peak_node.hpp:861
bool IsAccessStatusCacheable() const
Checks whether the node's access status is cacheable.
Definition peak_node.hpp:910
bool IsReadable() const
Returns whether the node is currently readable.
Definition peak_node.hpp:877
std::shared_ptr< Node > FindSelectedNode(const std::string &name) const
Tries to find a selected node with the given name.
Definition peak_node.hpp:1046
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:536
std::vector< std::shared_ptr< Node > > InvalidatedNodes() const
Returns the invalidated nodes.
Definition peak_node.hpp:990
std::vector< std::shared_ptr< Node > > SelectingNodes() const
Returns the selecting nodes.
Definition peak_node.hpp:1092
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:414
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:479
bool IsCacheable() const
Checks whether the node is cacheable.
Definition peak_node.hpp:903
std::string Description() const
Returns the description.
Definition peak_node.hpp:960
bool IsStreamable() const
Checks whether the node is streamable.
Definition peak_node.hpp:917
Node(Node &&other)=delete
bool IsImplemented() const
Returns whether the node is implemented.
Definition peak_node.hpp:895
bool IsAvailable() const
Returns whether the node is currently either readable or writeable.
Definition peak_node.hpp:889
NodeCachingMode CachingMode() const
Returns the caching mode.
Definition peak_node.hpp:938
std::shared_ptr< Node > FindInvalidatedNode(const std::string &name) const
Tries to find an invalidated node with the given name.
Definition peak_node.hpp:978
ChangedCallback * ChangedCallbackHandle
Definition peak_node.hpp:133
NodeAccessStatus AccessStatus() const
Returns the access status.
Definition peak_node.hpp:869
void UnregisterChangedCallback(ChangedCallbackHandle callbackHandle)
Unregisters a changed callback.
Definition peak_node.hpp:1120
Node(const Node &other)=delete
@ AccessStatus
Definition peak_device_descriptor.hpp:61
NodeVisibility
Definition peak_node.hpp:108
NodeType
Definition peak_node.hpp:91
NodeNamespace
Definition peak_node.hpp:81
NodeCachingMode
Definition peak_node.hpp:60
NodeAccessStatus
Definition peak_node.hpp:46
@ Expert
Definition peak_node.hpp:110
@ Beginner
Definition peak_node.hpp:109
@ Guru
Definition peak_node.hpp:111
@ Invisible
Definition peak_node.hpp:112
@ Register
Definition peak_node.hpp:97
@ Float
Definition peak_node.hpp:95
@ String
Definition peak_node.hpp:96
@ Boolean
Definition peak_node.hpp:93
@ Enumeration
Definition peak_node.hpp:99
@ Category
Definition peak_node.hpp:98
@ Integer
Definition peak_node.hpp:92
@ EnumerationEntry
Definition peak_node.hpp:100
@ Command
Definition peak_node.hpp:94
@ Custom
Definition peak_node.hpp:82
@ Standard
Definition peak_node.hpp:83
@ NoCache
Definition peak_node.hpp:64
@ WriteAround
Definition peak_node.hpp:72
@ WriteThrough
Definition peak_node.hpp:68
@ ReadOnly
Definition peak_node.hpp:50
@ NotAvailable
Definition peak_node.hpp:48
@ WriteOnly
Definition peak_node.hpp:49
@ ReadWrite
Definition peak_node.hpp:51
@ NotImplemented
Definition peak_node.hpp:47
@ Boolean
Definition peak_common_node_enums.hpp:63
The "nodes" namespace contains all GenAPI node types.
Definition peak_boolean_node.hpp:26
std::string ToString(NodeCacheUsePolicy entry)
Definition peak_common_node_enums.hpp:70
std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
Definition peak_node.hpp:660
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:34
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:35
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:582
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:429
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:225
int32_t PEAK_NODE_TYPE
Definition peak_backend.h:296
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:43
int32_t PEAK_NODE_CACHING_MODE
Definition peak_backend.h:234
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:268
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:306
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_C_ABI_PREFIX
Definition peak_dll_defines.h:16
#define PEAK_CALL_CONV
Definition peak_dynamic_loader.h:30