IDS peak genericC++ v1.9.0
Loading...
Searching...
No Matches
peak_node.hpp
Go to the documentation of this file.
1
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
58{
62 NoCache,
71};
72
77enum class NodeNamespace
78{
79 Custom,
81};
82
86enum class NodeType
87{
88 Integer,
89 Boolean,
90 Command,
91 Float,
92 String,
97};
98
103{
104 Beginner,
105 Expert,
106 Guru,
108};
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
222 bool IsCacheable() const;
223
234 bool IsAccessStatusCacheable() const;
235
246 bool IsStreamable() const;
247
258 bool IsDeprecated() const;
259
271 bool IsFeature() const;
272
283
293 int64_t PollingTime() const;
294
304 std::string ToolTip() const;
305
315 std::string Description() const;
316
329 NodeType Type() const;
330
340 std::shared_ptr<NodeMap> ParentNodeMap() const;
341
355 std::shared_ptr<Node> FindInvalidatedNode(const std::string& name) const;
356
371 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
372 std::shared_ptr<NodeType> FindInvalidatedNode(const std::string& name) const
373 {
374 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatedNode(name));
375 if (!castedNode)
376 {
377 throw InvalidCastException("Invalid node cast!");
378 }
379
380 return castedNode;
381 }
382
392 std::vector<std::shared_ptr<Node>> InvalidatedNodes() const;
393
407 std::shared_ptr<Node> FindInvalidatingNode(const std::string& name) const;
408
423 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
424 std::shared_ptr<NodeType> FindInvalidatingNode(const std::string& name) const
425 {
426 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindInvalidatingNode(name));
427 if (!castedNode)
428 {
429 throw InvalidCastException("Invalid node cast!");
430 }
431
432 return castedNode;
433 }
434
444 std::vector<std::shared_ptr<Node>> InvalidatingNodes() const;
445
459 std::shared_ptr<Node> FindSelectedNode(const std::string& name) const;
460
475 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
476 std::shared_ptr<NodeType> FindSelectedNode(const std::string& name) const
477 {
478 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectedNode(name));
479 if (!castedNode)
480 {
481 throw InvalidCastException("Invalid node cast!");
482 }
483
484 return castedNode;
485 }
486
496 std::vector<std::shared_ptr<Node>> SelectedNodes() const;
497
511 std::shared_ptr<Node> FindSelectingNode(const std::string& name) const;
512
527 template <class NodeType, typename std::enable_if<std::is_base_of<Node, NodeType>::value, int>::type = 0>
528 std::shared_ptr<NodeType> FindSelectingNode(const std::string& name) const
529 {
530 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindSelectingNode(name));
531 if (!castedNode)
532 {
533 throw InvalidCastException("Invalid node cast!");
534 }
535
536 return castedNode;
537 }
538
548 std::vector<std::shared_ptr<Node>> SelectingNodes() const;
549
565
578
579protected:
581 Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap);
583private:
584 struct NodeChangedCallbackContainer
585 {
586 std::shared_ptr<Node> _Node;
587 Node::ChangedCallback Callback;
588 };
589 static void PEAK_CALL_CONV ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context);
590
591 friend ClassCreator<Node>;
592 PEAK_NODE_HANDLE m_backendHandle;
593
594 std::weak_ptr<NodeMap> m_parentNodeMap;
595
596 std::unique_ptr<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>
597 m_changedCallbackManager;
598};
599
600inline std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
601{
602 return QueryStringFromCInterfaceFunction([&](char* nodeName, size_t* nodeNameSize) {
603 return PEAK_C_ABI_PREFIX PEAK_Node_GetName(nodeHandle, nodeName, nodeNameSize);
604 });
605}
606
607} /* namespace nodes */
608} /* namespace core */
609} /* namespace peak */
610
612
613/* Implementation */
614namespace peak
615{
616namespace core
617{
618namespace nodes
619{
620
621inline std::string ToString(NodeAccessStatus entry)
622{
623 std::string entryString;
624
626 {
627 entryString = "NotImplemented";
628 }
629 else if (entry == NodeAccessStatus::NotAvailable)
630 {
631 entryString = "NotAvailable";
632 }
633 else if (entry == NodeAccessStatus::WriteOnly)
634 {
635 entryString = "WriteOnly";
636 }
637 else if (entry == NodeAccessStatus::ReadOnly)
638 {
639 entryString = "ReadOnly";
640 }
641 else if (entry == NodeAccessStatus::ReadWrite)
642 {
643 entryString = "ReadWrite";
644 }
645
646 return entryString;
647}
648
649inline std::string ToString(NodeCachingMode entry)
650{
651 std::string entryString;
652
653 if (entry == NodeCachingMode::NoCache)
654 {
655 entryString = "NoCache";
656 }
657 else if (entry == NodeCachingMode::WriteThrough)
658 {
659 entryString = "WriteThrough";
660 }
661 else if (entry == NodeCachingMode::WriteAround)
662 {
663 entryString = "WriteAround";
664 }
665
666 return entryString;
667}
668
669inline std::string ToString(NodeNamespace entry)
670{
671 std::string entryString;
672
673 if (entry == NodeNamespace::Custom)
674 {
675 entryString = "Custom";
676 }
677 else if (entry == NodeNamespace::Standard)
678 {
679 entryString = "Standard";
680 }
681
682 return entryString;
683}
684
685inline std::string ToString(NodeType entry)
686{
687 std::string entryString;
688
689 if (entry == NodeType::Integer)
690 {
691 entryString = "Integer";
692 }
693 else if (entry == NodeType::Boolean)
694 {
695 entryString = "Boolean";
696 }
697 else if (entry == NodeType::Command)
698 {
699 entryString = "Command";
700 }
701 else if (entry == NodeType::Float)
702 {
703 entryString = "Float";
704 }
705 else if (entry == NodeType::String)
706 {
707 entryString = "String";
708 }
709 else if (entry == NodeType::Register)
710 {
711 entryString = "Register";
712 }
713 else if (entry == NodeType::Category)
714 {
715 entryString = "Category";
716 }
717 else if (entry == NodeType::Enumeration)
718 {
719 entryString = "Enumeration";
720 }
721 else if (entry == NodeType::EnumerationEntry)
722 {
723 entryString = "EnumerationEntry";
724 }
725
726 return entryString;
727}
728
729inline std::string ToString(NodeVisibility entry)
730{
731 std::string entryString;
732
733 if (entry == NodeVisibility::Beginner)
734 {
735 entryString = "Beginner";
736 }
737 else if (entry == NodeVisibility::Expert)
738 {
739 entryString = "Expert";
740 }
741 else if (entry == NodeVisibility::Guru)
742 {
743 entryString = "Guru";
744 }
745 else if (entry == NodeVisibility::Invisible)
746 {
747 entryString = "Invisible";
748 }
749
750 return entryString;
751}
752
754inline Node::Node(PEAK_NODE_HANDLE nodeHandle, const std::weak_ptr<peak::core::NodeMap>& parentNodeMap)
755 : m_backendHandle(nodeHandle)
756 , m_parentNodeMap(parentNodeMap)
757 , m_changedCallbackManager()
758{
759 m_changedCallbackManager =
760 std::make_unique<TCallbackManager<PEAK_NODE_CHANGED_CALLBACK_HANDLE, NodeChangedCallbackContainer>>(
761 [&](void* callbackContext) {
762 return QueryNumericFromCInterfaceFunction<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(
763 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE* nodeChangedCallbackHandle) {
765 m_backendHandle, ChangedCallbackCWrapper, callbackContext, nodeChangedCallbackHandle);
766 });
767 },
768 [&](PEAK_NODE_CHANGED_CALLBACK_HANDLE callbackHandle) {
769 CallAndCheckCInterfaceFunction([&] {
770 return PEAK_C_ABI_PREFIX PEAK_Node_UnregisterChangedCallback(m_backendHandle, callbackHandle);
771 });
772 });
773}
775
776inline Node::~Node()
777{
778 m_changedCallbackManager->UnregisterAllCallbacks();
779}
780
781inline std::string Node::Name() const
782{
783 return GetNodeName(m_backendHandle);
784}
785
786inline std::string Node::DisplayName() const
787{
788 return QueryStringFromCInterfaceFunction([&](char* displayName, size_t* displayNameSize) {
789 return PEAK_C_ABI_PREFIX PEAK_Node_GetDisplayName(m_backendHandle, displayName, displayNameSize);
790 });
791}
792
793inline NodeNamespace Node::Namespace() const
794{
795 return static_cast<NodeNamespace>(
796 QueryNumericFromCInterfaceFunction<PEAK_NODE_NAMESPACE>([&](PEAK_NODE_NAMESPACE* _namespace) {
797 return PEAK_C_ABI_PREFIX PEAK_Node_GetNamespace(m_backendHandle, _namespace);
798 }));
799}
800
801inline NodeVisibility Node::Visibility() const
802{
803 return static_cast<NodeVisibility>(
804 QueryNumericFromCInterfaceFunction<PEAK_NODE_VISIBILITY>([&](PEAK_NODE_VISIBILITY* visibility) {
805 return PEAK_C_ABI_PREFIX PEAK_Node_GetVisibility(m_backendHandle, visibility);
806 }));
807}
808
809inline NodeAccessStatus Node::AccessStatus() const
810{
811 return static_cast<NodeAccessStatus>(
812 QueryNumericFromCInterfaceFunction<PEAK_NODE_ACCESS_STATUS>([&](PEAK_NODE_ACCESS_STATUS* accessStatus) {
813 return PEAK_C_ABI_PREFIX PEAK_Node_GetAccessStatus(m_backendHandle, accessStatus);
814 }));
815}
816
817inline bool Node::IsReadable() const
818{
819 const auto accessStatus = AccessStatus();
820 return accessStatus == NodeAccessStatus::ReadOnly || accessStatus == NodeAccessStatus::ReadWrite;
821}
822
823inline bool Node::IsWriteable() const
824{
825 const auto accessStatus = AccessStatus();
826 return accessStatus == NodeAccessStatus::WriteOnly || accessStatus == NodeAccessStatus::ReadWrite;
827}
828
829inline bool Node::IsCacheable() const
830{
831 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isCacheable) {
832 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsCacheable(m_backendHandle, isCacheable);
833 }) > 0;
834}
835
836inline bool Node::IsAccessStatusCacheable() const
837{
838 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessStatusCacheable) {
839 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsAccessStatusCacheable(m_backendHandle, isAccessStatusCacheable);
840 }) > 0;
841}
842
843inline bool Node::IsStreamable() const
844{
845 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isStreamable) {
846 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsStreamable(m_backendHandle, isStreamable);
847 }) > 0;
848}
849
850inline bool Node::IsDeprecated() const
851{
852 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isDeprecated) {
853 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsDeprecated(m_backendHandle, isDeprecated);
854 }) > 0;
855}
856
857inline bool Node::IsFeature() const
858{
859 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isFeature) {
860 return PEAK_C_ABI_PREFIX PEAK_Node_GetIsFeature(m_backendHandle, isFeature);
861 }) > 0;
862}
863
864inline NodeCachingMode Node::CachingMode() const
865{
866 return static_cast<NodeCachingMode>(
867 QueryNumericFromCInterfaceFunction<PEAK_NODE_CACHING_MODE>([&](PEAK_NODE_CACHING_MODE* cachingMode) {
868 return PEAK_C_ABI_PREFIX PEAK_Node_GetCachingMode(m_backendHandle, cachingMode);
869 }));
870}
871
872inline int64_t Node::PollingTime() const
873{
874 return QueryNumericFromCInterfaceFunction<int64_t>([&](int64_t* pollingTime_ms) {
875 return PEAK_C_ABI_PREFIX PEAK_Node_GetPollingTime(m_backendHandle, pollingTime_ms);
876 });
877}
878
879inline std::string Node::ToolTip() const
880{
881 return QueryStringFromCInterfaceFunction([&](char* toolTip, size_t* toolTipSize) {
882 return PEAK_C_ABI_PREFIX PEAK_Node_GetToolTip(m_backendHandle, toolTip, toolTipSize);
883 });
884}
885
886inline std::string Node::Description() const
887{
888 return QueryStringFromCInterfaceFunction([&](char* description, size_t* descriptionSize) {
889 return PEAK_C_ABI_PREFIX PEAK_Node_GetDescription(m_backendHandle, description, descriptionSize);
890 });
891}
892
893inline NodeType Node::Type() const
894{
895 return static_cast<NodeType>(QueryNumericFromCInterfaceFunction<PEAK_NODE_TYPE>(
896 [&](PEAK_NODE_TYPE* type) { return PEAK_C_ABI_PREFIX PEAK_Node_GetType(m_backendHandle, type); }));
897}
898
899inline std::shared_ptr<peak::core::NodeMap> Node::ParentNodeMap() const
900{
901 return LockOrThrow(m_parentNodeMap);
902}
903
904inline std::shared_ptr<Node> Node::FindInvalidatedNode(const std::string& name) const
905{
906 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* _nodeHandle) {
908 m_backendHandle, name.c_str(), name.size() + 1, _nodeHandle);
909 });
910
911 auto nodeName = GetNodeName(nodeHandle);
912
913 return ParentNodeMap()->FindNode(name);
914}
915
916inline std::vector<std::shared_ptr<Node>> Node::InvalidatedNodes() const
917{
918 auto numInvalidatedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
919 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatedNodes(m_backendHandle, _numInvalidatedNodes);
920 });
921
922 std::vector<std::shared_ptr<Node>> invalidatedNodes;
923 for (size_t x = 0; x < numInvalidatedNodes; ++x)
924 {
925 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
926 [&](PEAK_NODE_HANDLE* _nodeHandle) {
927 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatedNode(m_backendHandle, x, _nodeHandle);
928 });
929
930 auto nodeName = GetNodeName(nodeHandle);
931
932 invalidatedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
933 }
934
935 return invalidatedNodes;
936}
937
938inline std::shared_ptr<Node> Node::FindInvalidatingNode(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::InvalidatingNodes() const
951{
952 auto numInvalidatingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numInvalidatedNodes) {
953 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumInvalidatingNodes(m_backendHandle, _numInvalidatedNodes);
954 });
955
956 std::vector<std::shared_ptr<Node>> invalidatingNodes;
957 for (size_t x = 0; x < numInvalidatingNodes; ++x)
958 {
959 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
960 [&](PEAK_NODE_HANDLE* _nodeHandle) {
961 return PEAK_C_ABI_PREFIX PEAK_Node_GetInvalidatingNode(m_backendHandle, x, _nodeHandle);
962 });
963
964 auto nodeName = GetNodeName(nodeHandle);
965
966 invalidatingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
967 }
968
969 return invalidatingNodes;
970}
971
972inline std::shared_ptr<Node> Node::FindSelectedNode(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::SelectedNodes() const
985{
986 auto numSelectedNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectedNodes) {
987 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectedNodes(m_backendHandle, _numSelectedNodes);
988 });
989
990 std::vector<std::shared_ptr<Node>> selectedNodes;
991 for (size_t x = 0; x < numSelectedNodes; ++x)
992 {
993 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
994 [&](PEAK_NODE_HANDLE* _nodeHandle) {
995 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectedNode(m_backendHandle, x, _nodeHandle);
996 });
997
998 auto nodeName = GetNodeName(nodeHandle);
999
1000 selectedNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1001 }
1002
1003 return selectedNodes;
1004}
1005
1006inline std::shared_ptr<Node> Node::FindSelectingNode(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::SelectingNodes() const
1019{
1020 auto numSelectingNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numSelectingNodes) {
1021 return PEAK_C_ABI_PREFIX PEAK_Node_GetNumSelectingNodes(m_backendHandle, _numSelectingNodes);
1022 });
1023
1024 std::vector<std::shared_ptr<Node>> selectingNodes;
1025 for (size_t x = 0; x < numSelectingNodes; ++x)
1026 {
1027 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
1028 [&](PEAK_NODE_HANDLE* _nodeHandle) {
1029 return PEAK_C_ABI_PREFIX PEAK_Node_GetSelectingNode(m_backendHandle, x, _nodeHandle);
1030 });
1031
1032 auto nodeName = GetNodeName(nodeHandle);
1033
1034 selectingNodes.emplace_back(ParentNodeMap()->FindNode(nodeName));
1035 }
1036
1037 return selectingNodes;
1038}
1039
1040inline Node::ChangedCallbackHandle Node::RegisterChangedCallback(const Node::ChangedCallback& callback)
1041{
1042 return reinterpret_cast<ChangedCallbackHandle>(
1043 m_changedCallbackManager->RegisterCallback(NodeChangedCallbackContainer{ shared_from_this(), callback }));
1044}
1045
1046inline void Node::UnregisterChangedCallback(Node::ChangedCallbackHandle callbackHandle)
1047{
1048 m_changedCallbackManager->UnregisterCallback(
1049 reinterpret_cast<PEAK_NODE_CHANGED_CALLBACK_HANDLE>(callbackHandle));
1050}
1051
1052inline void PEAK_CALL_CONV Node::ChangedCallbackCWrapper(PEAK_NODE_HANDLE, void* context)
1053{
1054 auto callbackContainer = static_cast<NodeChangedCallbackContainer*>(context);
1055
1056 callbackContainer->Callback(callbackContainer->_Node);
1057}
1058
1059} /* namespace nodes */
1060} /* namespace core */
1061} /* namespace peak */
The exception thrown for trying to apply an invalid cast.
Definition peak_exception.hpp:82
Represents a GenAPI node.
Definition peak_node.hpp:122
NodeType Type() const
Returns the type.
Definition peak_node.hpp:893
ChangedCallbackHandle RegisterChangedCallback(const ChangedCallback &callback)
Registers a callback for signaling a change to the node.
Definition peak_node.hpp:1040
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:528
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:857
bool IsDeprecated() const
Checks whether the node is deprecated.
Definition peak_node.hpp:850
std::string ToolTip() const
Returns the tool tip.
Definition peak_node.hpp:879
std::vector< std::shared_ptr< Node > > SelectedNodes() const
Returns the selected nodes.
Definition peak_node.hpp:984
std::string DisplayName() const
Returns the display name.
Definition peak_node.hpp:786
Node & operator=(const Node &other)=delete
NodeNamespace Namespace() const
Returns the namespace the node belongs to.
Definition peak_node.hpp:793
Node & operator=(Node &&other)=delete
bool IsWriteable() const
Returns whether the node is currently writeable.
Definition peak_node.hpp:823
std::shared_ptr< Node > FindSelectingNode(const std::string &name) const
Tries to find a selecting node with the given name.
Definition peak_node.hpp:1006
std::shared_ptr< NodeMap > ParentNodeMap() const
Returns the parent node map.
Definition peak_node.hpp:899
std::string Name() const
Returns the name.
Definition peak_node.hpp:781
int64_t PollingTime() const
Returns the polling time.
Definition peak_node.hpp:872
std::shared_ptr< Node > FindInvalidatingNode(const std::string &name) const
Tries to find an invalidating node with the given name.
Definition peak_node.hpp:938
std::vector< std::shared_ptr< Node > > InvalidatingNodes() const
Returns the invalidating nodes.
Definition peak_node.hpp:950
virtual ~Node()
Definition peak_node.hpp:776
NodeVisibility Visibility() const
Returns the visibility.
Definition peak_node.hpp:801
bool IsAccessStatusCacheable() const
Checks whether the node's access status is cacheable.
Definition peak_node.hpp:836
bool IsReadable() const
Returns whether the node is currently readable.
Definition peak_node.hpp:817
std::shared_ptr< Node > FindSelectedNode(const std::string &name) const
Tries to find a selected node with the given name.
Definition peak_node.hpp:972
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:476
std::vector< std::shared_ptr< Node > > InvalidatedNodes() const
Returns the invalidated nodes.
Definition peak_node.hpp:916
std::vector< std::shared_ptr< Node > > SelectingNodes() const
Returns the selecting nodes.
Definition peak_node.hpp:1018
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:372
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:424
bool IsCacheable() const
Checks whether the node is cacheable.
Definition peak_node.hpp:829
std::string Description() const
Returns the description.
Definition peak_node.hpp:886
bool IsStreamable() const
Checks whether the node is streamable.
Definition peak_node.hpp:843
Node(Node &&other)=delete
NodeCachingMode CachingMode() const
Returns the caching mode.
Definition peak_node.hpp:864
std::shared_ptr< Node > FindInvalidatedNode(const std::string &name) const
Tries to find an invalidated node with the given name.
Definition peak_node.hpp:904
ChangedCallback * ChangedCallbackHandle
Definition peak_node.hpp:127
NodeAccessStatus AccessStatus() const
Returns the access status.
Definition peak_node.hpp:809
void UnregisterChangedCallback(ChangedCallbackHandle callbackHandle)
Unregisters a changed callback.
Definition peak_node.hpp:1046
Node(const Node &other)=delete
NodeVisibility
Definition peak_node.hpp:103
NodeType
Definition peak_node.hpp:87
NodeNamespace
Definition peak_node.hpp:78
NodeCachingMode
Definition peak_node.hpp:58
std::string ToString(NodeCacheUsePolicy entry)
Definition peak_common_node_enums.hpp:54
NodeAccessStatus
Definition peak_node.hpp:45
std::string GetNodeName(PEAK_NODE_HANDLE nodeHandle)
Definition peak_node.hpp:600
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:561
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:412
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:208
int32_t PEAK_NODE_TYPE
Definition peak_backend.h:279
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:26
int32_t PEAK_NODE_CACHING_MODE
Definition peak_backend.h:217
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:251
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:289
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