IDS peak genericC++ v1.16.0
Loading...
Searching...
No Matches
peak_node_map.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>
18
19#include <type_traits>
20#include <unordered_map>
21#include <algorithm>
22#include <cstdint>
23#include <functional>
24#include <iterator>
25#include <memory>
26#include <mutex>
27#include <string>
28#include <vector>
29
30
31namespace peak
32{
33namespace core
34{
35namespace nodes
36{
37
38class BooleanNode;
39class CategoryNode;
40class CommandNode;
41class EnumerationNode;
43class FloatNode;
44class IntegerNode;
45class Node;
46class RegisterNode;
47class StringNode;
48
49} // namespace nodes
50
51class Buffer;
52
61 : public InitOnce
62 , public std::enable_shared_from_this<NodeMap>
63{
64public:
66 using NodeFilterFunction = std::function<bool(const std::shared_ptr<const nodes::Node>& nodeToFilter)>;
67
68
84 {
85 public:
88 ScopedNodeMapLock(const ScopedNodeMapLock& other) = delete;
92
93 private:
94 friend NodeMap;
95 friend ClassCreator<ScopedNodeMapLock>;
96 explicit ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap);
97 explicit ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap, std::adopt_lock_t t);
98 std::shared_ptr<NodeMap> m_nodeMap;
99 };
100
101 NodeMap() = delete;
102 ~NodeMap() = default;
103 NodeMap(const NodeMap& other) = delete;
104 NodeMap& operator=(const NodeMap& other) = delete;
105 NodeMap(NodeMap&& other) = delete;
106 NodeMap& operator=(NodeMap&& other) = delete;
107
120 bool HasNode(const std::string& name) const;
121
134 template <class NodeType, typename std::enable_if<std::is_base_of<nodes::Node, NodeType>::value, int>::type = 0>
135 bool HasNode(const std::string& name)
136 {
137 InitializeIfNecessary();
138 PEAK_NODE_HANDLE nodeHandle{ nullptr };
139 if (PEAK_C_ABI_PREFIX PEAK_NodeMap_FindNode(m_backendHandle, name.c_str(), name.size() + 1, &nodeHandle)
141 {
142 return false;
143 }
144
145 return std::dynamic_pointer_cast<NodeType>(m_nodesByName.at(name)) != nullptr;
146 }
147
161 std::shared_ptr<nodes::Node> FindNode(const std::string& name);
162
177 template <class NodeType, typename std::enable_if<std::is_base_of<nodes::Node, NodeType>::value, int>::type = 0>
178 std::shared_ptr<NodeType> FindNode(const std::string& name)
179 {
180 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindNode(name));
181 if (!castedNode)
182 {
183 throw InvalidCastException("Invalid node cast!");
184 }
185
186 return castedNode;
187 }
188
200 std::shared_ptr<nodes::Node> TryFindNode(const std::string& name);
201
214 template <class NodeType, typename std::enable_if<std::is_base_of<nodes::Node, NodeType>::value, int>::type = 0>
215 std::shared_ptr<NodeType> TryFindNode(const std::string& name)
216 {
217 auto node = TryFindNode(name);
218 if(node == nullptr)
219 {
220 return nullptr;
221 }
222
223 auto castedNode = std::dynamic_pointer_cast<NodeType>(node);
224 if (!castedNode)
225 {
226 throw InvalidCastException("Invalid node cast!");
227 }
228
229 return castedNode;
230 }
231
239 void InvalidateNodes();
240
261 void PollNodes(int64_t elapsedTime_ms);
262
272 std::vector<std::shared_ptr<nodes::Node>> Nodes() const;
273
284 bool HasBufferSupportedChunks(const std::shared_ptr<Buffer>& buffer) const;
285
299 void UpdateChunkNodes(const std::shared_ptr<Buffer>& buffer);
300
311 bool HasEventSupportedData(const std::unique_ptr<Event>& event) const;
312
326 void UpdateEventNodes(const std::unique_ptr<Event>& event);
327
343 void StoreToFile(const std::string& filePath) const;
344
360 void LoadFromFile(const std::string& filePath);
361
378 std::unique_ptr<ScopedNodeMapLock> Lock();
379
401 std::unique_ptr<ScopedNodeMapLock> TryLock();
402
413 {
414 return m_backendHandle;
415 }
416
417private:
418 std::shared_ptr<nodes::Node> NodeFromHandle(PEAK_NODE_HANDLE nodeHandle) const;
419
420 friend ClassCreator<NodeMap>;
421 explicit NodeMap(PEAK_NODE_MAP_HANDLE nodeMapHandle);
422 PEAK_NODE_MAP_HANDLE m_backendHandle;
423
424 void Initialize() const override;
425 mutable std::vector<std::shared_ptr<nodes::Node>> m_nodes;
426 mutable std::unordered_map<std::string, std::shared_ptr<nodes::Node>> m_nodesByName;
427};
428
429} /* namespace core */
430} /* namespace peak */
431
442
443
444/* Implementation */
445namespace peak
446{
447namespace core
448{
449
450inline NodeMap::NodeMap(PEAK_NODE_MAP_HANDLE nodeMapHandle)
451 : m_backendHandle(nodeMapHandle)
452 , m_nodes()
453 , m_nodesByName()
454{}
455
456inline bool NodeMap::HasNode(const std::string& name) const
457{
458 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasNode) {
459 return PEAK_C_ABI_PREFIX PEAK_NodeMap_GetHasNode(m_backendHandle, name.c_str(), name.size() + 1, hasNode);
460 }) > 0;
461}
462
463inline std::shared_ptr<nodes::Node> NodeMap::FindNode(const std::string& name)
464{
465 InitializeIfNecessary();
466
467 (void)QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* nodeHandle) {
469 m_backendHandle, name.c_str(), name.size() + 1, nodeHandle);
470 });
471
472 return m_nodesByName.at(name);
473}
474
475inline std::shared_ptr<nodes::Node> NodeMap::TryFindNode(const std::string& name)
476{
477 InitializeIfNecessary();
478
479 const auto cNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* nodeHandle) {
481 m_backendHandle, name.c_str(), name.size() + 1, nodeHandle);
482 });
483
484 if(cNodeHandle == nullptr)
485 {
486 return nullptr;
487 }
488
489 return m_nodesByName.at(name);
490}
491
493{
494 CallAndCheckCInterfaceFunction(
495 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_InvalidateNodes(m_backendHandle); });
496}
497
498inline void NodeMap::PollNodes(int64_t elapsedTime_ms)
499{
500 CallAndCheckCInterfaceFunction(
501 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_PollNodes(m_backendHandle, elapsedTime_ms); });
502}
503
504inline std::vector<std::shared_ptr<nodes::Node>> NodeMap::Nodes() const
505{
506 InitializeIfNecessary();
507
508 return m_nodes;
509}
510
511inline bool NodeMap::HasEventSupportedData(const std::unique_ptr<Event>& event) const
512{
513 if (event == nullptr)
514 {
515 throw InvalidArgumentException("The given event is a nullptr!");
516 }
517
518 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasSupportedData) {
520 m_backendHandle, event->m_backendHandle, hasSupportedData);
521 }) > 0;
522}
523
524inline void NodeMap::UpdateEventNodes(const std::unique_ptr<Event>& event)
525{
526 if (event == nullptr)
527 {
528 throw InvalidArgumentException("The given event is a nullptr!");
529 }
530
531 CallAndCheckCInterfaceFunction(
532 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_UpdateEventNodes(m_backendHandle, event->m_backendHandle); });
533}
534
535inline void NodeMap::StoreToFile(const std::string& filePath) const
536{
537 CallAndCheckCInterfaceFunction([&] {
538 return PEAK_C_ABI_PREFIX PEAK_NodeMap_StoreToFile(m_backendHandle, filePath.c_str(), filePath.size() + 1);
539 });
540}
541
542inline void NodeMap::LoadFromFile(const std::string& filePath)
543{
544 InitializeIfNecessary();
545
546 CallAndCheckCInterfaceFunction([&] {
548 m_backendHandle, filePath.c_str(), filePath.size() + 1);
549 });
550}
551
552inline NodeMap::ScopedNodeMapLock::ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap)
553 : m_nodeMap(nodeMap)
554{
555 CallAndCheckCInterfaceFunction(
556 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_Lock(m_nodeMap->m_backendHandle); });
557}
558
559inline NodeMap::ScopedNodeMapLock::ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap, std::adopt_lock_t)
560 : m_nodeMap(nodeMap)
561{
562
563}
564
566{
567 CallAndCheckCInterfaceFunction(
568 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_Unlock(m_nodeMap->m_backendHandle); });
569}
570
571inline std::unique_ptr<NodeMap::ScopedNodeMapLock> NodeMap::Lock()
572{
573 return std::make_unique<ClassCreator<ScopedNodeMapLock>>(shared_from_this());
574}
575
576inline std::unique_ptr<NodeMap::ScopedNodeMapLock> NodeMap::TryLock()
577{
578 PEAK_BOOL8 locked{false};
579 CallAndCheckCInterfaceFunction(
580 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_TryLock(m_backendHandle, &locked); });
581
582 if (!locked)
583 {
584 return {};
585 }
586
587 return std::make_unique<ClassCreator<ScopedNodeMapLock>>(shared_from_this(), std::adopt_lock);
588}
589
590inline std::shared_ptr<nodes::Node> NodeMap::NodeFromHandle(PEAK_NODE_HANDLE nodeHandle) const
591{
592 auto nodeType = QueryNumericFromCInterfaceFunction<PEAK_NODE_TYPE>(
593 [&](PEAK_NODE_TYPE* _nodeType) { return PEAK_C_ABI_PREFIX PEAK_Node_GetType(nodeHandle, _nodeType); });
594
595 switch (nodeType)
596 {
598 auto integerNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_INTEGER_NODE_HANDLE>(
599 [&](PEAK_INTEGER_NODE_HANDLE* _integerNodeHandle) {
600 return PEAK_C_ABI_PREFIX PEAK_Node_ToIntegerNode(nodeHandle, _integerNodeHandle);
601 });
602
603 return std::make_shared<ClassCreator<nodes::IntegerNode>>(
604 integerNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
605 }
607 auto booleanNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_BOOLEAN_NODE_HANDLE>(
608 [&](PEAK_BOOLEAN_NODE_HANDLE* _booleanNodeHandle) {
609 return PEAK_C_ABI_PREFIX PEAK_Node_ToBooleanNode(nodeHandle, _booleanNodeHandle);
610 });
611
612 return std::make_shared<ClassCreator<nodes::BooleanNode>>(
613 booleanNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
614 }
616 auto commandNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_COMMAND_NODE_HANDLE>(
617 [&](PEAK_COMMAND_NODE_HANDLE* _commandNodeHandle) {
618 return PEAK_C_ABI_PREFIX PEAK_Node_ToCommandNode(nodeHandle, _commandNodeHandle);
619 });
620
621 return std::make_shared<ClassCreator<nodes::CommandNode>>(
622 commandNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
623 }
625 auto floatNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_FLOAT_NODE_HANDLE>(
626 [&](PEAK_FLOAT_NODE_HANDLE* _floatNodeHandle) {
627 return PEAK_C_ABI_PREFIX PEAK_Node_ToFloatNode(nodeHandle, _floatNodeHandle);
628 });
629
630 return std::make_shared<ClassCreator<nodes::FloatNode>>(
631 floatNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
632 }
634 auto stringNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_STRING_NODE_HANDLE>(
635 [&](PEAK_STRING_NODE_HANDLE* _stringNodeHandle) {
636 return PEAK_C_ABI_PREFIX PEAK_Node_ToStringNode(nodeHandle, _stringNodeHandle);
637 });
638
639 return std::make_shared<ClassCreator<nodes::StringNode>>(
640 stringNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
641 }
643 auto registerNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_REGISTER_NODE_HANDLE>(
644 [&](PEAK_REGISTER_NODE_HANDLE* _registerNodeHandle) {
645 return PEAK_C_ABI_PREFIX PEAK_Node_ToRegisterNode(nodeHandle, _registerNodeHandle);
646 });
647
648 return std::make_shared<ClassCreator<nodes::RegisterNode>>(
649 registerNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
650 }
652 auto categoryNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_CATEGORY_NODE_HANDLE>(
653 [&](PEAK_CATEGORY_NODE_HANDLE* _categoryNodeHandle) {
654 return PEAK_C_ABI_PREFIX PEAK_Node_ToCategoryNode(nodeHandle, _categoryNodeHandle);
655 });
656
657 return std::make_shared<ClassCreator<nodes::CategoryNode>>(
658 categoryNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
659 }
661 auto enumerationNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_ENUMERATION_NODE_HANDLE>(
662 [&](PEAK_ENUMERATION_NODE_HANDLE* _enumerationNodeHandle) {
663 return PEAK_C_ABI_PREFIX PEAK_Node_ToEnumerationNode(nodeHandle, _enumerationNodeHandle);
664 });
665
666 return std::make_shared<ClassCreator<nodes::EnumerationNode>>(
667 enumerationNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
668 }
670 auto enumerationEntryNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_ENUMERATION_ENTRY_NODE_HANDLE>(
671 [&](PEAK_ENUMERATION_ENTRY_NODE_HANDLE* _enumerationEntryNodeHandle) {
673 nodeHandle, _enumerationEntryNodeHandle);
674 });
675
676 return std::make_shared<ClassCreator<nodes::EnumerationEntryNode>>(
677 enumerationEntryNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
678 }
679 default: {
680 return std::make_shared<ClassCreator<nodes::Node>>(
681 nodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
682 }
683 }
684}
685
686inline void NodeMap::Initialize() const
687{
688 auto numNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numNodes) {
689 return PEAK_C_ABI_PREFIX PEAK_NodeMap_GetNumNodes(m_backendHandle, _numNodes);
690 });
691
692 for (size_t x = 0; x < numNodes; ++x)
693 {
694 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
695 [&](PEAK_NODE_HANDLE* _nodeHandle) {
696 return PEAK_C_ABI_PREFIX PEAK_NodeMap_GetNode(m_backendHandle, x, _nodeHandle);
697 });
698
699 auto node = NodeFromHandle(nodeHandle);
700
701 m_nodes.emplace_back(node);
702 m_nodesByName.emplace(node->Name(), node);
703 }
704}
705
706} /* namespace core */
707} /* namespace peak */
Represents a GenTL buffer module.
Definition peak_buffer.hpp:87
The exception thrown for passing an invalid argument to a function.
Definition peak_exception.hpp:116
The exception thrown for trying to apply an invalid cast.
Definition peak_exception.hpp:142
ScopedNodeMapLock(ScopedNodeMapLock &&other)=delete
ScopedNodeMapLock & operator=(ScopedNodeMapLock &&other)=delete
ScopedNodeMapLock & operator=(const ScopedNodeMapLock &other)=delete
ScopedNodeMapLock(const ScopedNodeMapLock &other)=delete
~ScopedNodeMapLock()
Definition peak_node_map.hpp:565
PEAK_NODE_MAP_HANDLE Handle() const
Get the backend handle.
Definition peak_node_map.hpp:412
std::shared_ptr< nodes::Node > FindNode(const std::string &name)
Find a node with the given name.
Definition peak_node_map.hpp:463
bool HasNode(const std::string &name) const
Checks whether the node map contains a node with the given name.
Definition peak_node_map.hpp:456
bool HasEventSupportedData(const std::unique_ptr< Event > &event) const
Checks if the Event contains data corresponding to the NodeMap.
Definition peak_node_map.hpp:511
void StoreToFile(const std::string &filePath) const
Stores the values of streamable nodes to the file at the given file path.
Definition peak_node_map.hpp:535
bool HasNode(const std::string &name)
Checks whether the node map contains a node with the given name and type.
Definition peak_node_map.hpp:135
NodeMap & operator=(const NodeMap &other)=delete
std::unique_ptr< ScopedNodeMapLock > Lock()
Acquires the NodeMap lock. Use this function to synchronize sequences of dependent NodeMap operations...
Definition peak_node_map.hpp:571
NodeMap(const NodeMap &other)=delete
void PollNodes(int64_t elapsedTime_ms)
Polls all nodes having a polling time.
Definition peak_node_map.hpp:498
std::shared_ptr< NodeType > TryFindNode(const std::string &name)
Tries to find a node with the given name and type.
Definition peak_node_map.hpp:215
std::vector< std::shared_ptr< nodes::Node > > Nodes() const
Returns the nodes.
Definition peak_node_map.hpp:504
std::function< bool(const std::shared_ptr< const nodes::Node > &nodeToFilter)> NodeFilterFunction
Definition peak_node_map.hpp:66
void UpdateChunkNodes(const std::shared_ptr< Buffer > &buffer)
Updates chunk information in the NodeMap.
Definition peak_buffer.hpp:1026
void InvalidateNodes()
Invalidates all nodes.
Definition peak_node_map.hpp:492
std::shared_ptr< NodeType > FindNode(const std::string &name)
Find a node with the given name and type.
Definition peak_node_map.hpp:178
NodeMap(NodeMap &&other)=delete
void LoadFromFile(const std::string &filePath)
Loads the values of streamable nodes from the file at the given file path.
Definition peak_node_map.hpp:542
bool HasBufferSupportedChunks(const std::shared_ptr< Buffer > &buffer) const
Checks if the Buffer contains chunks corresponding to the NodeMap.
Definition peak_buffer.hpp:1013
std::unique_ptr< ScopedNodeMapLock > TryLock()
Attempts to acquire the NodeMap lock without blocking. Use this function to synchronize sequences of ...
Definition peak_node_map.hpp:576
NodeMap & operator=(NodeMap &&other)=delete
void UpdateEventNodes(const std::unique_ptr< Event > &event)
Updates event information in the NodeMap.
Definition peak_node_map.hpp:524
std::shared_ptr< nodes::Node > TryFindNode(const std::string &name)
Tries to find a node with the given name.
Definition peak_node_map.hpp:475
Represents a GenAPI boolean node.
Definition peak_boolean_node.hpp:34
Represents a GenAPI category node.
Definition peak_category_node.hpp:37
Represents a GenAPI command node.
Definition peak_command_node.hpp:35
Represents a GenAPI enumeration entry node.
Definition peak_enumeration_entry_node.hpp:37
Represents a GenAPI enumeration node.
Definition peak_enumeration_node.hpp:40
Represents a GenAPI float node.
Definition peak_float_node.hpp:48
Represents a GenAPI integer node.
Definition peak_integer_node.hpp:38
Represents a GenAPI node.
Definition peak_node.hpp:128
Represents a GenAPI register node.
Definition peak_register_node.hpp:39
Represents a GenAPI string node.
Definition peak_string_node.hpp:36
The "nodes" namespace contains all GenAPI node types.
Definition peak_boolean_node.hpp:26
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_ToEnumerationEntryNode(PEAK_NODE_HANDLE nodeHandle, PEAK_ENUMERATION_ENTRY_NODE_HANDLE *enumerationEntryNodeHandle)
Casts the given node to an enumeration entry node.
@ PEAK_NODE_TYPE_BOOLEAN
Definition peak_backend.h:287
@ PEAK_NODE_TYPE_FLOAT
Definition peak_backend.h:289
@ PEAK_NODE_TYPE_COMMAND
Definition peak_backend.h:288
@ PEAK_NODE_TYPE_CATEGORY
Definition peak_backend.h:292
@ PEAK_NODE_TYPE_ENUMERATION_ENTRY
Definition peak_backend.h:294
@ PEAK_NODE_TYPE_ENUMERATION
Definition peak_backend.h:293
@ PEAK_NODE_TYPE_STRING
Definition peak_backend.h:290
@ PEAK_NODE_TYPE_INTEGER
Definition peak_backend.h:286
@ PEAK_NODE_TYPE_REGISTER
Definition peak_backend.h:291
PEAK_C_API PEAK_NodeMap_GetNode(PEAK_NODE_MAP_HANDLE nodeMapHandle, size_t index, PEAK_NODE_HANDLE *nodeHandle)
Asks the given node map for the node with the given index.
PEAK_C_API PEAK_Node_ToRegisterNode(PEAK_NODE_HANDLE nodeHandle, PEAK_REGISTER_NODE_HANDLE *registerNodeHandle)
Casts the given node to a register node.
PEAK_C_API PEAK_NodeMap_UpdateEventNodes(PEAK_NODE_MAP_HANDLE nodeMapHandle, PEAK_EVENT_HANDLE eventHandle)
Updates event information in the node map.
PEAK_C_API PEAK_NodeMap_Lock(PEAK_NODE_MAP_HANDLE nodeMapHandle)
Locks a recursive mutex on the NodeMap.
struct PEAK_ENUMERATION_NODE * PEAK_ENUMERATION_NODE_HANDLE
Definition peak_backend.h:461
PEAK_C_API PEAK_NodeMap_GetHasEventSupportedData(PEAK_NODE_MAP_HANDLE nodeMapHandle, PEAK_EVENT_HANDLE eventHandle, PEAK_BOOL8 *hasSupportedData)
Checks if the event contains data corresponding to the node map.
struct PEAK_COMMAND_NODE * PEAK_COMMAND_NODE_HANDLE
Definition peak_backend.h:441
struct PEAK_STRING_NODE * PEAK_STRING_NODE_HANDLE
Definition peak_backend.h:449
PEAK_C_API PEAK_Node_ToBooleanNode(PEAK_NODE_HANDLE nodeHandle, PEAK_BOOLEAN_NODE_HANDLE *booleanNodeHandle)
Casts the given node to a boolean node.
struct PEAK_NODE * PEAK_NODE_HANDLE
Definition peak_backend.h:429
PEAK_C_API PEAK_NodeMap_TryLock(PEAK_NODE_MAP_HANDLE nodeMapHandle, PEAK_BOOL8 *locked)
Tries to Lock a recursive mutex on the NodeMap. Use this to synchronize NodeMap access from multiple ...
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_TYPE
Definition peak_backend.h:296
PEAK_C_API PEAK_Node_ToFloatNode(PEAK_NODE_HANDLE nodeHandle, PEAK_FLOAT_NODE_HANDLE *floatNodeHandle)
Casts the given node to a float node.
PEAK_C_API PEAK_NodeMap_GetHasNode(PEAK_NODE_MAP_HANDLE nodeMapHandle, const char *nodeName, size_t nodeNameSize, PEAK_BOOL8 *hasNode)
Checks whether the given node map contains a node with the given name.
PEAK_C_API PEAK_Node_ToIntegerNode(PEAK_NODE_HANDLE nodeHandle, PEAK_INTEGER_NODE_HANDLE *integerNodeHandle)
Casts the given node to an integer node.
PEAK_C_API PEAK_NodeMap_PollNodes(PEAK_NODE_MAP_HANDLE nodeMapHandle, int64_t elapsedTime_ms)
Tells the given node map to poll its nodes.
PEAK_C_API PEAK_NodeMap_StoreToFile(PEAK_NODE_MAP_HANDLE nodeMapHandle, const char *filePath, size_t filePathSize)
Tells the given node map to store the values of its streamable nodes to a file at the given file path...
struct PEAK_FLOAT_NODE * PEAK_FLOAT_NODE_HANDLE
Definition peak_backend.h:445
PEAK_C_API PEAK_Node_ToEnumerationNode(PEAK_NODE_HANDLE nodeHandle, PEAK_ENUMERATION_NODE_HANDLE *enumerationNodeHandle)
Casts the given node to an enumeration node.
PEAK_C_API PEAK_NodeMap_GetNumNodes(PEAK_NODE_MAP_HANDLE nodeMapHandle, size_t *numNodes)
Asks the given node map for its number of nodes.
PEAK_C_API PEAK_NodeMap_FindNode(PEAK_NODE_MAP_HANDLE nodeMapHandle, const char *nodeName, size_t nodeNameSize, PEAK_NODE_HANDLE *nodeHandle)
Tells the given node map to find a node with the given name.
PEAK_C_API PEAK_Node_ToCategoryNode(PEAK_NODE_HANDLE nodeHandle, PEAK_CATEGORY_NODE_HANDLE *categoryNodeHandle)
Casts the given node to a category node.
int8_t PEAK_BOOL8
Definition peak_backend.h:43
struct PEAK_NODE_MAP * PEAK_NODE_MAP_HANDLE
Definition peak_backend.h:425
struct PEAK_ENUMERATION_ENTRY_NODE * PEAK_ENUMERATION_ENTRY_NODE_HANDLE
Definition peak_backend.h:465
struct PEAK_CATEGORY_NODE * PEAK_CATEGORY_NODE_HANDLE
Definition peak_backend.h:457
struct PEAK_REGISTER_NODE * PEAK_REGISTER_NODE_HANDLE
Definition peak_backend.h:453
PEAK_C_API PEAK_Node_ToStringNode(PEAK_NODE_HANDLE nodeHandle, PEAK_STRING_NODE_HANDLE *stringNodeHandle)
Casts the given node to a string node.
PEAK_C_API PEAK_Node_ToCommandNode(PEAK_NODE_HANDLE nodeHandle, PEAK_COMMAND_NODE_HANDLE *commandNodeHandle)
Casts the given node to a command node.
@ PEAK_RETURN_CODE_SUCCESS
Definition peak_backend.h:334
PEAK_C_API PEAK_NodeMap_Unlock(PEAK_NODE_MAP_HANDLE nodeMapHandle)
Unlocks the recursive mutex on the NodeMap.
PEAK_C_API PEAK_NodeMap_InvalidateNodes(PEAK_NODE_MAP_HANDLE nodeMapHandle)
Tells the given node map to invalidate its nodes.
struct PEAK_BOOLEAN_NODE * PEAK_BOOLEAN_NODE_HANDLE
Definition peak_backend.h:437
struct PEAK_INTEGER_NODE * PEAK_INTEGER_NODE_HANDLE
Definition peak_backend.h:433
PEAK_C_API PEAK_NodeMap_LoadFromFile(PEAK_NODE_MAP_HANDLE nodeMapHandle, const char *filePath, size_t filePathSize)
Tells the given node map to load the values of its streamable nodes from a file at the given file pat...
PEAK_C_API PEAK_NodeMap_TryFindNode(PEAK_NODE_MAP_HANDLE nodeMapHandle, const char *nodeName, size_t nodeNameSize, PEAK_NODE_HANDLE *nodeHandle)
Tells the given node map to try to find a node with the given name.
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:16