IDS peak genericC++ v1.12.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
52
72
77enum class NodeNamespace
78{
81};
82
98
109
111struct NodeChangedCallbackContainer;
113
121class Node : public std::enable_shared_from_this<Node>
122{
123public:
125 using ChangedCallback = std::function<void(const std::shared_ptr<Node>& changedNode)>;
128
129 Node() = delete;
130 virtual ~Node();
131 Node(const Node& other) = delete;
132 Node& operator=(const Node& other) = delete;
133 Node(Node&& other) = delete;
134 Node& operator=(Node&& other) = delete;
135
145 std::string Name() const;
146
156 std::string DisplayName() const;
157
167 NodeNamespace Namespace() const;
168
179
191
200 bool IsReadable() const;
201
210 bool IsWriteable() const;
211
220 bool IsAvailable() const;
221
230 bool IsImplemented() const;
231
242 bool IsCacheable() const;
243
254 bool IsAccessStatusCacheable() const;
255
266 bool IsStreamable() const;
267
278 bool IsDeprecated() const;
279
291 bool IsFeature() const;
292
303
313 int64_t PollingTime() const;
314
324 std::string ToolTip() const;
325
335 std::string Description() const;
336
349 NodeType Type() const;
350
360 std::shared_ptr<NodeMap> ParentNodeMap() const;
361
375 std::shared_ptr<Node> FindInvalidatedNode(const std::string& name) const;
376
391 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
392 std::shared_ptr<NodeType> FindInvalidatedNode(const std::string& name) const
393 {
394 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatedNode(name));
395 if (!castedNode)
396 {
397 throw InvalidCastException("Invalid node cast!");
398 }
399
400 return castedNode;
401 }
402
412 std::vector<std::shared_ptr<Node>> InvalidatedNodes() const;
413
427 std::shared_ptr<Node> FindInvalidatingNode(const std::string& name) const;
428
443 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
444 std::shared_ptr<NodeType> FindInvalidatingNode(const std::string& name) const
445 {
446 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatingNode(name));
447 if (!castedNode)
448 {
449 throw InvalidCastException("Invalid node cast!");
450 }
451
452 return castedNode;
453 }
454
464 std::vector<std::shared_ptr<Node>> InvalidatingNodes() const;
465
479 std::shared_ptr<Node> FindSelectedNode(const std::string& name) const;
480
495 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
496 std::shared_ptr<NodeType> FindSelectedNode(const std::string& name) const
497 {
498 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectedNode(name));
499 if (!castedNode)
500 {
501 throw InvalidCastException("Invalid node cast!");
502 }
503
504 return castedNode;
505 }
506
516 std::vector<std::shared_ptr<Node>> SelectedNodes() const;
517
531 std::shared_ptr<Node> FindSelectingNode(const std::string& name) const;
532
547 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
548 std::shared_ptr<NodeType> FindSelectingNode(const std::string& name) const
549 {
550 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectingNode(name));
551 if (!castedNode)
552 {
553 throw InvalidCastException("Invalid node cast!");
554 }
555
556 return castedNode;
557 }
558
568 std::vector<std::shared_ptr<Node>> SelectingNodes() const;
569
585
598
599protected:
601 Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap);
603private:
604 struct NodeChangedCallbackContainer
605 {
606 std::shared_ptr<Node> _Node;
607 Node::ChangedCallback Callback;
608 };
609 static void PEAK_CALL_CONV ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context);
610
611 friend ClassCreator<Node>;
612 PEAK_NODE_HANDLE m_backendHandle;
613
614 std::weak_ptr<NodeMap> m_parentNodeMap;
615
616 std::unique_ptr<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>
617 m_changedCallbackManager;
618};
619
620inline std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
621{
622 return QueryStringFromCInterfaceFunction([&](char* nodeName, size_t* nodeNameSize) {
623 return PEAK_C_ABI_PREFIX PEAK_Node_GetName(nodeHandle, nodeName, nodeNameSize);
624 });
625}
626
627} /* namespace nodes */
628} /* namespace core */
629} /* namespace peak */
630
632
633/* Implementation */
634namespace peak
635{
636namespace core
637{
638namespace nodes
639{
640
641inline std::string ToString(NodeAccessStatus entry)
642{
643 std::string entryString;
644
646 {
647 entryString = "NotImplemented";
648 }
649 else if (entry == NodeAccessStatus::NotAvailable)
650 {
651 entryString = "NotAvailable";
652 }
653 else if (entry == NodeAccessStatus::WriteOnly)
654 {
655 entryString = "WriteOnly";
656 }
657 else if (entry == NodeAccessStatus::ReadOnly)
658 {
659 entryString = "ReadOnly";
660 }
661 else if (entry == NodeAccessStatus::ReadWrite)
662 {
663 entryString = "ReadWrite";
664 }
665
666 return entryString;
667}
668
669inline std::string ToString(NodeCachingMode entry)
670{
671 std::string entryString;
672
673 if (entry == NodeCachingMode::NoCache)
674 {
675 entryString = "NoCache";
676 }
677 else if (entry == NodeCachingMode::WriteThrough)
678 {
679 entryString = "WriteThrough";
680 }
681 else if (entry == NodeCachingMode::WriteAround)
682 {
683 entryString = "WriteAround";
684 }
685
686 return entryString;
687}
688
689inline std::string ToString(NodeNamespace entry)
690{
691 std::string entryString;
692
693 if (entry == NodeNamespace::Custom)
694 {
695 entryString = "Custom";
696 }
697 else if (entry == NodeNamespace::Standard)
698 {
699 entryString = "Standard";
700 }
701
702 return entryString;
703}
704
705inline std::string ToString(NodeType entry)
706{
707 std::string entryString;
708
709 if (entry == NodeType::Integer)
710 {
711 entryString = "Integer";
712 }
713 else if (entry == NodeType::Boolean)
714 {
715 entryString = "Boolean";
716 }
717 else if (entry == NodeType::Command)
718 {
719 entryString = "Command";
720 }
721 else if (entry == NodeType::Float)
722 {
723 entryString = "Float";
724 }
725 else if (entry == NodeType::String)
726 {
727 entryString = "String";
728 }
729 else if (entry == NodeType::Register)
730 {
731 entryString = "Register";
732 }
733 else if (entry == NodeType::Category)
734 {
735 entryString = "Category";
736 }
737 else if (entry == NodeType::Enumeration)
738 {
739 entryString = "Enumeration";
740 }
741 else if (entry == NodeType::EnumerationEntry)
742 {
743 entryString = "EnumerationEntry";
744 }
745
746 return entryString;
747}
748
749inline std::string ToString(NodeVisibility entry)
750{
751 std::string entryString;
752
753 if (entry == NodeVisibility::Beginner)
754 {
755 entryString = "Beginner";
756 }
757 else if (entry == NodeVisibility::Expert)
758 {
759 entryString = "Expert";
760 }
761 else if (entry == NodeVisibility::Guru)
762 {
763 entryString = "Guru";
764 }
765 else if (entry == NodeVisibility::Invisible)
766 {
767 entryString = "Invisible";
768 }
769
770 return entryString;
771}
772
774inline Node::Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap)
775 : m_backendHandle(nodeHandle)
776 , m_parentNodeMap(parentNodeMap)
777 , m_changedCallbackManager()
778{
779 m_changedCallbackManager =
780 std::make_unique<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>(
781 [&](void* callbackContext) {
782 return QueryNumericFromCInterfaceFunction<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(
783 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE* nodeChangedCallbackHandle) {
785 m_backendHandle, ChangedCallbackCWrapper, callbackContext, nodeChangedCallbackHandle);
786 });
787 },
788 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE callbackHandle) {
789 CallAndCheckCInterfaceFunction([&] {
790 return PEAK_C_ABI_PREFIX PEAK_Node_UnregisterChangedCallback(m_backendHandle, callbackHandle);
791 });
792 });
793}
795
797{
798 m_changedCallbackManager->UnregisterAllCallbacks();
799}
800
801inline std::string Node::Name() const
802{
803 return GetNodeName(m_backendHandle);
804}
805
806inline std::string Node::DisplayName() const
807{
808 return QueryStringFromCInterfaceFunction([&](char* displayName, size_t* displayNameSize) {
809 return PEAK_C_ABI_PREFIX PEAK_Node_GetDisplayName(m_backendHandle, displayName, displayNameSize);
810 });
811}
812
814{
815 return static_cast<NodeNamespace>(
816 QueryNumericFromCInterfaceFunction<PEAK_NODE_NAMESPACE>([&](PEAK_NODE_NAMESPACE* _namespace) {
817 return PEAK_C_ABI_PREFIX PEAK_Node_GetNamespace(m_backendHandle, _namespace);
818 }));
819}
820
822{
823 return static_cast<NodeVisibility>(
824 QueryNumericFromCInterfaceFunction<PEAK_NODE_VISIBILITY>([&](PEAK_NODE_VISIBILITY* visibility) {
825 return PEAK_C_ABI_PREFIX PEAK_Node_GetVisibility(m_backendHandle, visibility);
826 }));
827}
828
830{
831 return static_cast<NodeAccessStatus>(
832 QueryNumericFromCInterfaceFunction<PEAK_NODE_ACCESS_STATUS>([&](PEAK_NODE_ACCESS_STATUS* accessStatus) {
833 return PEAK_C_ABI_PREFIX PEAK_Node_GetAccessStatus(m_backendHandle, accessStatus);
834 }));
835}
836
837inline bool Node::IsReadable() const
838{
839 const auto accessStatus = AccessStatus();
840 return accessStatus == NodeAccessStatus::ReadOnly || accessStatus == NodeAccessStatus::ReadWrite;
841}
842
843inline bool Node::IsWriteable() const
844{
845 const auto accessStatus = AccessStatus();
846 return accessStatus == NodeAccessStatus::WriteOnly || accessStatus == NodeAccessStatus::ReadWrite;
847}
848
849inline bool Node::IsAvailable() const
850{
851 const auto accessStatus = AccessStatus();
852 return accessStatus != NodeAccessStatus::NotImplemented && accessStatus != NodeAccessStatus::NotAvailable;
853}
854
855inline bool Node::IsImplemented() const
856{
857 const auto accessStatus = AccessStatus();
858 return accessStatus != NodeAccessStatus::NotImplemented;
859}
860
861
862
863inline bool Node::IsCacheable() const
864{
865 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isCacheable) {
866 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsCacheable(m_backendHandle, isCacheable);
867 }) > 0;
868}
869
871{
872 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessStatusCacheable) {
873 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsAccessStatusCacheable(m_backendHandle, isAccessStatusCacheable);
874 }) > 0;
875}
876
877inline bool Node::IsStreamable() const
878{
879 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isStreamable) {
880 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsStreamable(m_backendHandle, isStreamable);
881 }) > 0;
882}
883
884inline bool Node::IsDeprecated() const
885{
886 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isDeprecated) {
887 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsDeprecated(m_backendHandle, isDeprecated);
888 }) > 0;
889}
890
891inline bool Node::IsFeature() const
892{
893 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isFeature) {
894 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsFeature(m_backendHandle, isFeature);
895 }) > 0;
896}
897
899{
900 return static_cast<NodeCachingMode>(
901 QueryNumericFromCInterfaceFunction<PEAK_NODE_CACHING_MODE>([&](PEAK_NODE_CACHING_MODE* cachingMode) {
902 return PEAK_C_ABI_PREFIX PEAK_Node_GetCachingMode(m_backendHandle, cachingMode);
903 }));
904}
905
906inline int64_t Node::PollingTime() const
907{
908 return QueryNumericFromCInterfaceFunction<int64_t>([&](int64_t* pollingTime_ms) {
909 return PEAK_C_ABI_PREFIX PEAK_Node_GetPollingTime(m_backendHandle, pollingTime_ms);
910 });
911}
912
913inline std::string Node::ToolTip() const
914{
915 return QueryStringFromCInterfaceFunction([&](char* toolTip, size_t* toolTipSize) {
916 return PEAK_C_ABI_PREFIX PEAK_Node_GetToolTip(m_backendHandle, toolTip, toolTipSize);
917 });
918}
919
920inline std::string Node::Description() const
921{
922 return QueryStringFromCInterfaceFunction([&](char* description, size_t* descriptionSize) {
923 return PEAK_C_ABI_PREFIX PEAK_Node_GetDescription(m_backendHandle, description, descriptionSize);
924 });
925}
926
927inline NodeType Node::Type() const
928{
929 return static_cast<NodeType>(QueryNumericFromCInterfaceFunction<PEAK_NODE_TYPE>(
930 [&](PEAK_NODE_TYPE* type) { return PEAK_C_ABI_PREFIX PEAK_Node_GetType(m_backendHandle, type); }));
931}
932
933inline std::shared_ptr<peak::core::NodeMap> Node::ParentNodeMap() const
934{
935 return LockOrThrow(m_parentNodeMap);
936}
937
938inline std::shared_ptr<Node> Node::FindInvalidatedNode(const std::string& name) const
939{
940 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
942 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
943 });
944
945 auto nodeName = GetNodeName(nodeHandle);
946
947 return ParentNodeMap()->FindNode(name);
948}
949
950inline std::vector<std::shared_ptr<Node>> Node::InvalidatedNodes() const
951{
952 auto numInvalidatedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
953 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatedNodes(m_backendHandle, _numInvalidatedNodes);
954 });
955
956 std::vector<std::shared_ptr<Node>> invalidatedNodes;
957 for (size_t x = 0; x < numInvalidatedNodes; ++x)
958 {
959 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
960 [&](PEAK_NODE_HANDLE* _nodeHandle) {
961 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatedNode(m_backendHandle, x, _nodeHandle);
962 });
963
964 auto nodeName = GetNodeName(nodeHandle);
965
966 invalidatedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
967 }
968
969 return invalidatedNodes;
970}
971
972inline std::shared_ptr<Node> Node::FindInvalidatingNode(const std::string& name) const
973{
974 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
976 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
977 });
978
979 auto nodeName = GetNodeName(nodeHandle);
980
981 return ParentNodeMap()->FindNode(name);
982}
983
984inline std::vector<std::shared_ptr<Node>> Node::InvalidatingNodes() const
985{
986 auto numInvalidatingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
987 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatingNodes(m_backendHandle, _numInvalidatedNodes);
988 });
989
990 std::vector<std::shared_ptr<Node>> invalidatingNodes;
991 for (size_t x = 0; x < numInvalidatingNodes; ++x)
992 {
993 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
994 [&](PEAK_NODE_HANDLE* _nodeHandle) {
995 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatingNode(m_backendHandle, x, _nodeHandle);
996 });
997
998 auto nodeName = GetNodeName(nodeHandle);
999
1000 invalidatingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1001 }
1002
1003 return invalidatingNodes;
1004}
1005
1006inline std::shared_ptr<Node> Node::FindSelectedNode(const std::string& name) const
1007{
1008 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1010 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1011 });
1012
1013 auto nodeName = GetNodeName(nodeHandle);
1014
1015 return ParentNodeMap()->FindNode(name);
1016}
1017
1018inline std::vector<std::shared_ptr<Node>> Node::SelectedNodes() const
1019{
1020 auto numSelectedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectedNodes) {
1021 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectedNodes(m_backendHandle, _numSelectedNodes);
1022 });
1023
1024 std::vector<std::shared_ptr<Node>> selectedNodes;
1025 for (size_t x = 0; x < numSelectedNodes; ++x)
1026 {
1027 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1028 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1029 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectedNode(m_backendHandle, x, _nodeHandle);
1030 });
1031
1032 auto nodeName = GetNodeName(nodeHandle);
1033
1034 selectedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1035 }
1036
1037 return selectedNodes;
1038}
1039
1040inline std::shared_ptr<Node> Node::FindSelectingNode(const std::string& name) const
1041{
1042 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
1044 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
1045 });
1046
1047 auto nodeName = GetNodeName(nodeHandle);
1048
1049 return ParentNodeMap()->FindNode(name);
1050}
1051
1052inline std::vector<std::shared_ptr<Node>> Node::SelectingNodes() const
1053{
1054 auto numSelectingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectingNodes) {
1055 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectingNodes(m_backendHandle, _numSelectingNodes);
1056 });
1057
1058 std::vector<std::shared_ptr<Node>> selectingNodes;
1059 for (size_t x = 0; x < numSelectingNodes; ++x)
1060 {
1061 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1062 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1063 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectingNode(m_backendHandle, x, _nodeHandle);
1064 });
1065
1066 auto nodeName = GetNodeName(nodeHandle);
1067
1068 selectingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1069 }
1070
1071 return selectingNodes;
1072}
1073
1075{
1076 return reinterpret_cast<ChangedCallbackHandle>(
1077 m_changedCallbackManager->RegisterCallback(NodeChangedCallbackContainer{ shared_from_this(), callback }));
1078}
1079
1081{
1082 m_changedCallbackManager->UnregisterCallback(
1083 reinterpret_cast<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(callbackHandle));
1084}
1085
1086inline void PEAK_CALL_CONV Node::ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context)
1087{
1088 auto callbackContainer = static_cast<NodeChangedCallbackContainer*>(context);
1089
1090 callbackContainer->Callback(callbackContainer->_Node);
1091}
1092
1093} /* namespace nodes */
1094} /* namespace core */
1095} /* namespace peak */
The exception thrown for trying to apply an invalid cast.
Definition peak_exception.hpp:134
Represents a GenAPI node map.
Definition peak_node_map.hpp:62
NodeType Type() const
Returns the type.
Definition peak_node.hpp:927
ChangedCallbackHandle RegisterChangedCallback(const ChangedCallback &callback)
Registers a callback for signaling a change to the node.
Definition peak_node.hpp:1074
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:548
std::function< void(const std::shared_ptr< Node > &changedNode)> ChangedCallback
Definition peak_node.hpp:125
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:891
bool IsDeprecated() const
Checks whether the node is deprecated.
Definition peak_node.hpp:884
std::string ToolTip() const
Returns the tool tip.
Definition peak_node.hpp:913
std::vector< std::shared_ptr< Node > > SelectedNodes() const
Returns the selected nodes.
Definition peak_node.hpp:1018
std::string DisplayName() const
Returns the display name.
Definition peak_node.hpp:806
Node & operator=(const Node &other)=delete
NodeNamespace Namespace() const
Returns the namespace the node belongs to.
Definition peak_node.hpp:813
Node & operator=(Node &&other)=delete
bool IsWriteable() const
Returns whether the node is currently writeable.
Definition peak_node.hpp:843
std::shared_ptr< Node > FindSelectingNode(const std::string &name) const
Tries to find a selecting node with the given name.
Definition peak_node.hpp:1040
std::shared_ptr< NodeMap > ParentNodeMap() const
Returns the parent node map.
Definition peak_node.hpp:933
std::string Name() const
Returns the name.
Definition peak_node.hpp:801
int64_t PollingTime() const
Returns the polling time.
Definition peak_node.hpp:906
std::shared_ptr< Node > FindInvalidatingNode(const std::string &name) const
Tries to find an invalidating node with the given name.
Definition peak_node.hpp:972
std::vector< std::shared_ptr< Node > > InvalidatingNodes() const
Returns the invalidating nodes.
Definition peak_node.hpp:984
virtual ~Node()
Definition peak_node.hpp:796
NodeVisibility Visibility() const
Returns the visibility.
Definition peak_node.hpp:821
bool IsAccessStatusCacheable() const
Checks whether the node's access status is cacheable.
Definition peak_node.hpp:870
bool IsReadable() const
Returns whether the node is currently readable.
Definition peak_node.hpp:837
std::shared_ptr< Node > FindSelectedNode(const std::string &name) const
Tries to find a selected node with the given name.
Definition peak_node.hpp:1006
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:496
std::vector< std::shared_ptr< Node > > InvalidatedNodes() const
Returns the invalidated nodes.
Definition peak_node.hpp:950
std::vector< std::shared_ptr< Node > > SelectingNodes() const
Returns the selecting nodes.
Definition peak_node.hpp:1052
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:392
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:444
bool IsCacheable() const
Checks whether the node is cacheable.
Definition peak_node.hpp:863
std::string Description() const
Returns the description.
Definition peak_node.hpp:920
bool IsStreamable() const
Checks whether the node is streamable.
Definition peak_node.hpp:877
Node(Node &&other)=delete
bool IsImplemented() const
Returns whether the node is implemented.
Definition peak_node.hpp:855
bool IsAvailable() const
Returns whether the node is currently either readable or writeable.
Definition peak_node.hpp:849
NodeCachingMode CachingMode() const
Returns the caching mode.
Definition peak_node.hpp:898
std::shared_ptr< Node > FindInvalidatedNode(const std::string &name) const
Tries to find an invalidated node with the given name.
Definition peak_node.hpp:938
ChangedCallback * ChangedCallbackHandle
Definition peak_node.hpp:127
NodeAccessStatus AccessStatus() const
Returns the access status.
Definition peak_node.hpp:829
void UnregisterChangedCallback(ChangedCallbackHandle callbackHandle)
Unregisters a changed callback.
Definition peak_node.hpp:1080
Node(const Node &other)=delete
The "nodes" namespace contains all GenAPI node types.
Definition peak_boolean_node.hpp:26
NodeVisibility
Definition peak_node.hpp:103
@ Expert
Definition peak_node.hpp:105
@ Beginner
Definition peak_node.hpp:104
@ Guru
Definition peak_node.hpp:106
@ Invisible
Definition peak_node.hpp:107
NodeType
Definition peak_node.hpp:87
@ Register
Definition peak_node.hpp:93
@ Float
Definition peak_node.hpp:91
@ String
Definition peak_node.hpp:92
@ Boolean
Definition peak_node.hpp:89
@ Enumeration
Definition peak_node.hpp:95
@ Category
Definition peak_node.hpp:94
@ Integer
Definition peak_node.hpp:88
@ EnumerationEntry
Definition peak_node.hpp:96
@ Command
Definition peak_node.hpp:90
NodeNamespace
Definition peak_node.hpp:78
@ Custom
Definition peak_node.hpp:79
@ Standard
Definition peak_node.hpp:80
NodeCachingMode
Definition peak_node.hpp:58
@ NoCache
Definition peak_node.hpp:62
@ WriteAround
Definition peak_node.hpp:70
@ WriteThrough
Definition peak_node.hpp:66
std::string ToString(NodeCacheUsePolicy entry)
Definition peak_common_node_enums.hpp:54
NodeAccessStatus
Definition peak_node.hpp:45
@ ReadOnly
Definition peak_node.hpp:49
@ NotAvailable
Definition peak_node.hpp:47
@ WriteOnly
Definition peak_node.hpp:48
@ ReadWrite
Definition peak_node.hpp:50
@ NotImplemented
Definition peak_node.hpp:46
@ Boolean
Definition peak_common_node_enums.hpp:47
std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
Definition peak_node.hpp:620
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:34
@ AccessStatus
Definition peak_device_descriptor.hpp:59
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