IDS peak genericC++ v1.14.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
248 bool IsCacheable() const;
249
260 bool IsAccessStatusCacheable() const;
261
272 bool IsStreamable() const;
273
284 bool IsDeprecated() const;
285
297 bool IsFeature() const;
298
309
319 int64_t PollingTime() const;
320
330 std::string ToolTip() const;
331
341 std::string Description() const;
342
355 NodeType Type() const;
356
366 std::shared_ptr<NodeMap> ParentNodeMap() const;
367
381 std::shared_ptr<Node> FindInvalidatedNode(const std::string& name) const;
382
397 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
398 std::shared_ptr<NodeType> FindInvalidatedNode(const std::string& name) const
399 {
400 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatedNode(name));
401 if (!castedNode)
402 {
403 throw InvalidCastException("Invalid node cast!");
404 }
405
406 return castedNode;
407 }
408
418 std::vector<std::shared_ptr<Node>> InvalidatedNodes() const;
419
433 std::shared_ptr<Node> FindInvalidatingNode(const std::string& name) const;
434
449 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
450 std::shared_ptr<NodeType> FindInvalidatingNode(const std::string& name) const
451 {
452 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatingNode(name));
453 if (!castedNode)
454 {
455 throw InvalidCastException("Invalid node cast!");
456 }
457
458 return castedNode;
459 }
460
470 std::vector<std::shared_ptr<Node>> InvalidatingNodes() const;
471
485 std::shared_ptr<Node> FindSelectedNode(const std::string& name) const;
486
501 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
502 std::shared_ptr<NodeType> FindSelectedNode(const std::string& name) const
503 {
504 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectedNode(name));
505 if (!castedNode)
506 {
507 throw InvalidCastException("Invalid node cast!");
508 }
509
510 return castedNode;
511 }
512
522 std::vector<std::shared_ptr<Node>> SelectedNodes() const;
523
537 std::shared_ptr<Node> FindSelectingNode(const std::string& name) const;
538
553 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
554 std::shared_ptr<NodeType> FindSelectingNode(const std::string& name) const
555 {
556 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectingNode(name));
557 if (!castedNode)
558 {
559 throw InvalidCastException("Invalid node cast!");
560 }
561
562 return castedNode;
563 }
564
574 std::vector<std::shared_ptr<Node>> SelectingNodes() const;
575
591
604
605protected:
607 Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap);
609private:
610 struct NodeChangedCallbackContainer
611 {
612 std::shared_ptr<Node> _Node;
613 Node::ChangedCallback Callback;
614 };
615 static void PEAK_CALL_CONV ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context);
616
617 friend ClassCreator<Node>;
618 PEAK_NODE_HANDLE m_backendHandle;
619
620 std::weak_ptr<NodeMap> m_parentNodeMap;
621
622 std::unique_ptr<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>
623 m_changedCallbackManager;
624};
625
626inline std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
627{
628 return QueryStringFromCInterfaceFunction([&](char* nodeName, size_t* nodeNameSize) {
629 return PEAK_C_ABI_PREFIX PEAK_Node_GetName(nodeHandle, nodeName, nodeNameSize);
630 });
631}
632
633} /* namespace nodes */
634} /* namespace core */
635} /* namespace peak */
636
638
639/* Implementation */
640namespace peak
641{
642namespace core
643{
644namespace nodes
645{
646
647inline std::string ToString(NodeAccessStatus entry)
648{
649 std::string entryString;
650
652 {
653 entryString = "NotImplemented";
654 }
655 else if (entry == NodeAccessStatus::NotAvailable)
656 {
657 entryString = "NotAvailable";
658 }
659 else if (entry == NodeAccessStatus::WriteOnly)
660 {
661 entryString = "WriteOnly";
662 }
663 else if (entry == NodeAccessStatus::ReadOnly)
664 {
665 entryString = "ReadOnly";
666 }
667 else if (entry == NodeAccessStatus::ReadWrite)
668 {
669 entryString = "ReadWrite";
670 }
671
672 return entryString;
673}
674
675inline std::string ToString(NodeCachingMode entry)
676{
677 std::string entryString;
678
679 if (entry == NodeCachingMode::NoCache)
680 {
681 entryString = "NoCache";
682 }
683 else if (entry == NodeCachingMode::WriteThrough)
684 {
685 entryString = "WriteThrough";
686 }
687 else if (entry == NodeCachingMode::WriteAround)
688 {
689 entryString = "WriteAround";
690 }
691
692 return entryString;
693}
694
695inline std::string ToString(NodeNamespace entry)
696{
697 std::string entryString;
698
699 if (entry == NodeNamespace::Custom)
700 {
701 entryString = "Custom";
702 }
703 else if (entry == NodeNamespace::Standard)
704 {
705 entryString = "Standard";
706 }
707
708 return entryString;
709}
710
711inline std::string ToString(NodeType entry)
712{
713 std::string entryString;
714
715 if (entry == NodeType::Integer)
716 {
717 entryString = "Integer";
718 }
719 else if (entry == NodeType::Boolean)
720 {
721 entryString = "Boolean";
722 }
723 else if (entry == NodeType::Command)
724 {
725 entryString = "Command";
726 }
727 else if (entry == NodeType::Float)
728 {
729 entryString = "Float";
730 }
731 else if (entry == NodeType::String)
732 {
733 entryString = "String";
734 }
735 else if (entry == NodeType::Register)
736 {
737 entryString = "Register";
738 }
739 else if (entry == NodeType::Category)
740 {
741 entryString = "Category";
742 }
743 else if (entry == NodeType::Enumeration)
744 {
745 entryString = "Enumeration";
746 }
747 else if (entry == NodeType::EnumerationEntry)
748 {
749 entryString = "EnumerationEntry";
750 }
751
752 return entryString;
753}
754
755inline std::string ToString(NodeVisibility entry)
756{
757 std::string entryString;
758
759 if (entry == NodeVisibility::Beginner)
760 {
761 entryString = "Beginner";
762 }
763 else if (entry == NodeVisibility::Expert)
764 {
765 entryString = "Expert";
766 }
767 else if (entry == NodeVisibility::Guru)
768 {
769 entryString = "Guru";
770 }
771 else if (entry == NodeVisibility::Invisible)
772 {
773 entryString = "Invisible";
774 }
775
776 return entryString;
777}
778
780inline Node::Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap)
781 : m_backendHandle(nodeHandle)
782 , m_parentNodeMap(parentNodeMap)
783 , m_changedCallbackManager()
784{
785 m_changedCallbackManager =
786 std::make_unique<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>(
787 [&](void* callbackContext) {
788 return QueryNumericFromCInterfaceFunction<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(
789 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE* nodeChangedCallbackHandle) {
791 m_backendHandle, ChangedCallbackCWrapper, callbackContext, nodeChangedCallbackHandle);
792 });
793 },
794 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE callbackHandle) {
795 CallAndCheckCInterfaceFunction([&] {
796 return PEAK_C_ABI_PREFIX PEAK_Node_UnregisterChangedCallback(m_backendHandle, callbackHandle);
797 });
798 });
799}
801
803{
804 m_changedCallbackManager->UnregisterAllCallbacks();
805}
806
807inline std::string Node::Name() const
808{
809 return GetNodeName(m_backendHandle);
810}
811
812inline std::string Node::DisplayName() const
813{
814 return QueryStringFromCInterfaceFunction([&](char* displayName, size_t* displayNameSize) {
815 return PEAK_C_ABI_PREFIX PEAK_Node_GetDisplayName(m_backendHandle, displayName, displayNameSize);
816 });
817}
818
820{
821 return static_cast<NodeNamespace>(
822 QueryNumericFromCInterfaceFunction<PEAK_NODE_NAMESPACE>([&](PEAK_NODE_NAMESPACE* _namespace) {
823 return PEAK_C_ABI_PREFIX PEAK_Node_GetNamespace(m_backendHandle, _namespace);
824 }));
825}
826
828{
829 return static_cast<NodeVisibility>(
830 QueryNumericFromCInterfaceFunction<PEAK_NODE_VISIBILITY>([&](PEAK_NODE_VISIBILITY* visibility) {
831 return PEAK_C_ABI_PREFIX PEAK_Node_GetVisibility(m_backendHandle, visibility);
832 }));
833}
834
836{
837 return static_cast<NodeAccessStatus>(
838 QueryNumericFromCInterfaceFunction<PEAK_NODE_ACCESS_STATUS>([&](PEAK_NODE_ACCESS_STATUS* accessStatus) {
839 return PEAK_C_ABI_PREFIX PEAK_Node_GetAccessStatus(m_backendHandle, accessStatus);
840 }));
841}
842
843inline bool Node::IsReadable() const
844{
845 const auto accessStatus = AccessStatus();
846 return accessStatus == NodeAccessStatus::ReadOnly || accessStatus == NodeAccessStatus::ReadWrite;
847}
848
849inline bool Node::IsWriteable() const
850{
851 const auto accessStatus = AccessStatus();
852 return accessStatus == NodeAccessStatus::WriteOnly || accessStatus == NodeAccessStatus::ReadWrite;
853}
854
855inline bool Node::IsAvailable() const
856{
857 const auto accessStatus = AccessStatus();
858 return accessStatus != NodeAccessStatus::NotImplemented && accessStatus != NodeAccessStatus::NotAvailable;
859}
860
861inline bool Node::IsImplemented() const
862{
863 const auto accessStatus = AccessStatus();
864 return accessStatus != NodeAccessStatus::NotImplemented;
865}
866
867
868
869inline bool Node::IsCacheable() const
870{
871 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isCacheable) {
872 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsCacheable(m_backendHandle, isCacheable);
873 }) > 0;
874}
875
877{
878 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessStatusCacheable) {
879 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsAccessStatusCacheable(m_backendHandle, isAccessStatusCacheable);
880 }) > 0;
881}
882
883inline bool Node::IsStreamable() const
884{
885 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isStreamable) {
886 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsStreamable(m_backendHandle, isStreamable);
887 }) > 0;
888}
889
890inline bool Node::IsDeprecated() const
891{
892 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isDeprecated) {
893 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsDeprecated(m_backendHandle, isDeprecated);
894 }) > 0;
895}
896
897inline bool Node::IsFeature() const
898{
899 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isFeature) {
900 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsFeature(m_backendHandle, isFeature);
901 }) > 0;
902}
903
905{
906 return static_cast<NodeCachingMode>(
907 QueryNumericFromCInterfaceFunction<PEAK_NODE_CACHING_MODE>([&](PEAK_NODE_CACHING_MODE* cachingMode) {
908 return PEAK_C_ABI_PREFIX PEAK_Node_GetCachingMode(m_backendHandle, cachingMode);
909 }));
910}
911
912inline int64_t Node::PollingTime() const
913{
914 return QueryNumericFromCInterfaceFunction<int64_t>([&](int64_t* pollingTime_ms) {
915 return PEAK_C_ABI_PREFIX PEAK_Node_GetPollingTime(m_backendHandle, pollingTime_ms);
916 });
917}
918
919inline std::string Node::ToolTip() const
920{
921 return QueryStringFromCInterfaceFunction([&](char* toolTip, size_t* toolTipSize) {
922 return PEAK_C_ABI_PREFIX PEAK_Node_GetToolTip(m_backendHandle, toolTip, toolTipSize);
923 });
924}
925
926inline std::string Node::Description() const
927{
928 return QueryStringFromCInterfaceFunction([&](char* description, size_t* descriptionSize) {
929 return PEAK_C_ABI_PREFIX PEAK_Node_GetDescription(m_backendHandle, description, descriptionSize);
930 });
931}
932
933inline NodeType Node::Type() const
934{
935 return static_cast<NodeType>(QueryNumericFromCInterfaceFunction<PEAK_NODE_TYPE>(
936 [&](PEAK_NODE_TYPE* type) { return PEAK_C_ABI_PREFIX PEAK_Node_GetType(m_backendHandle, type); }));
937}
938
939inline std::shared_ptr<peak::core::NodeMap> Node::ParentNodeMap() const
940{
941 return LockOrThrow(m_parentNodeMap);
942}
943
944inline std::shared_ptr<Node> Node::FindInvalidatedNode(const std::string& name) const
945{
946 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
948 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
949 });
950
951 auto nodeName = GetNodeName(nodeHandle);
952
953 return ParentNodeMap()->FindNode(name);
954}
955
956inline std::vector<std::shared_ptr<Node>> Node::InvalidatedNodes() const
957{
958 auto numInvalidatedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
959 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatedNodes(m_backendHandle, _numInvalidatedNodes);
960 });
961
962 std::vector<std::shared_ptr<Node>> invalidatedNodes;
963 for (size_t x = 0; x < numInvalidatedNodes; ++x)
964 {
965 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
966 [&](PEAK_NODE_HANDLE* _nodeHandle) {
967 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatedNode(m_backendHandle, x, _nodeHandle);
968 });
969
970 auto nodeName = GetNodeName(nodeHandle);
971
972 invalidatedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
973 }
974
975 return invalidatedNodes;
976}
977
978inline std::shared_ptr<Node> Node::FindInvalidatingNode(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::InvalidatingNodes() const
991{
992 auto numInvalidatingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
993 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatingNodes(m_backendHandle, _numInvalidatedNodes);
994 });
995
996 std::vector<std::shared_ptr<Node>> invalidatingNodes;
997 for (size_t x = 0; x < numInvalidatingNodes; ++x)
998 {
999 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1000 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1001 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatingNode(m_backendHandle, x, _nodeHandle);
1002 });
1003
1004 auto nodeName = GetNodeName(nodeHandle);
1005
1006 invalidatingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1007 }
1008
1009 return invalidatingNodes;
1010}
1011
1012inline std::shared_ptr<Node> Node::FindSelectedNode(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::SelectedNodes() const
1025{
1026 auto numSelectedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectedNodes) {
1027 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectedNodes(m_backendHandle, _numSelectedNodes);
1028 });
1029
1030 std::vector<std::shared_ptr<Node>> selectedNodes;
1031 for (size_t x = 0; x < numSelectedNodes; ++x)
1032 {
1033 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1034 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1035 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectedNode(m_backendHandle, x, _nodeHandle);
1036 });
1037
1038 auto nodeName = GetNodeName(nodeHandle);
1039
1040 selectedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1041 }
1042
1043 return selectedNodes;
1044}
1045
1046inline std::shared_ptr<Node> Node::FindSelectingNode(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::SelectingNodes() const
1059{
1060 auto numSelectingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectingNodes) {
1061 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectingNodes(m_backendHandle, _numSelectingNodes);
1062 });
1063
1064 std::vector<std::shared_ptr<Node>> selectingNodes;
1065 for (size_t x = 0; x < numSelectingNodes; ++x)
1066 {
1067 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1068 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1069 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectingNode(m_backendHandle, x, _nodeHandle);
1070 });
1071
1072 auto nodeName = GetNodeName(nodeHandle);
1073
1074 selectingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1075 }
1076
1077 return selectingNodes;
1078}
1079
1081{
1082 return reinterpret_cast<ChangedCallbackHandle>(
1083 m_changedCallbackManager->RegisterCallback(NodeChangedCallbackContainer{ shared_from_this(), callback }));
1084}
1085
1087{
1088 m_changedCallbackManager->UnregisterCallback(
1089 reinterpret_cast<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(callbackHandle));
1090}
1091
1092inline void PEAK_CALL_CONV Node::ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context)
1093{
1094 auto callbackContainer = static_cast<NodeChangedCallbackContainer*>(context);
1095
1096 callbackContainer->Callback(callbackContainer->_Node);
1097}
1098
1099} /* namespace nodes */
1100} /* namespace core */
1101} /* 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:933
ChangedCallbackHandle RegisterChangedCallback(const ChangedCallback &callback)
Registers a callback for signaling a change to the node.
Definition peak_node.hpp:1080
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:554
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:897
bool IsDeprecated() const
Checks whether the node is deprecated.
Definition peak_node.hpp:890
std::string ToolTip() const
Returns the tool tip.
Definition peak_node.hpp:919
std::vector< std::shared_ptr< Node > > SelectedNodes() const
Returns the selected nodes.
Definition peak_node.hpp:1024
std::string DisplayName() const
Returns the display name.
Definition peak_node.hpp:812
Node & operator=(const Node &other)=delete
NodeNamespace Namespace() const
Returns the namespace the node belongs to.
Definition peak_node.hpp:819
Node & operator=(Node &&other)=delete
bool IsWriteable() const
Returns whether the node is currently writeable.
Definition peak_node.hpp:849
std::shared_ptr< Node > FindSelectingNode(const std::string &name) const
Tries to find a selecting node with the given name.
Definition peak_node.hpp:1046
std::shared_ptr< NodeMap > ParentNodeMap() const
Returns the parent node map.
Definition peak_node.hpp:939
std::string Name() const
Returns the name.
Definition peak_node.hpp:807
int64_t PollingTime() const
Returns the polling time.
Definition peak_node.hpp:912
std::shared_ptr< Node > FindInvalidatingNode(const std::string &name) const
Tries to find an invalidating node with the given name.
Definition peak_node.hpp:978
std::vector< std::shared_ptr< Node > > InvalidatingNodes() const
Returns the invalidating nodes.
Definition peak_node.hpp:990
virtual ~Node()
Definition peak_node.hpp:802
NodeVisibility Visibility() const
Returns the visibility.
Definition peak_node.hpp:827
bool IsAccessStatusCacheable() const
Checks whether the node's access status is cacheable.
Definition peak_node.hpp:876
bool IsReadable() const
Returns whether the node is currently readable.
Definition peak_node.hpp:843
std::shared_ptr< Node > FindSelectedNode(const std::string &name) const
Tries to find a selected node with the given name.
Definition peak_node.hpp:1012
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:502
std::vector< std::shared_ptr< Node > > InvalidatedNodes() const
Returns the invalidated nodes.
Definition peak_node.hpp:956
std::vector< std::shared_ptr< Node > > SelectingNodes() const
Returns the selecting nodes.
Definition peak_node.hpp:1058
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:398
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:450
bool IsCacheable() const
Checks whether the node is cacheable.
Definition peak_node.hpp:869
std::string Description() const
Returns the description.
Definition peak_node.hpp:926
bool IsStreamable() const
Checks whether the node is streamable.
Definition peak_node.hpp:883
Node(Node &&other)=delete
bool IsImplemented() const
Returns whether the node is implemented.
Definition peak_node.hpp:861
bool IsAvailable() const
Returns whether the node is currently either readable or writeable.
Definition peak_node.hpp:855
NodeCachingMode CachingMode() const
Returns the caching mode.
Definition peak_node.hpp:904
std::shared_ptr< Node > FindInvalidatedNode(const std::string &name) const
Tries to find an invalidated node with the given name.
Definition peak_node.hpp:944
ChangedCallback * ChangedCallbackHandle
Definition peak_node.hpp:133
NodeAccessStatus AccessStatus() const
Returns the access status.
Definition peak_node.hpp:835
void UnregisterChangedCallback(ChangedCallbackHandle callbackHandle)
Unregisters a changed callback.
Definition peak_node.hpp:1086
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:50
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:57
std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
Definition peak_node.hpp:626
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:33
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