IDS peak genericC++ v1.11.1
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
60 : public InitOnce
61 , public std::enable_shared_from_this<NodeMap>
62{
63public:
65 using NodeFilterFunction = std::function<bool(const std::shared_ptr<const nodes::Node>& nodeToFilter)>;
66
73 {
74 public:
77 ScopedNodeMapLock(const ScopedNodeMapLock& other) = delete;
81
82 private:
83 friend NodeMap;
84 friend ClassCreator<ScopedNodeMapLock>;
85 explicit ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap);
86 explicit ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap, std::adopt_lock_t t);
87 std::shared_ptr<NodeMap> m_nodeMap;
88 };
89
90 NodeMap() = delete;
91 ~NodeMap() = default;
92 NodeMap(const NodeMap& other) = delete;
93 NodeMap& operator=(const NodeMap& other) = delete;
94 NodeMap(NodeMap&& other) = delete;
95 NodeMap& operator=(NodeMap&& other) = delete;
96
106 bool HasNode(const std::string& name) const;
107
117 template <class NodeType, typename std::enable_if<std::is_base_of<nodes::Node, NodeType>::value, int>::type = 0>
118 bool HasNode(const std::string& name)
119 {
120 InitializeIfNecessary();
121 PEAK_NODE_HANDLE nodeHandle{ nullptr };
122 if (PEAK_C_ABI_PREFIX PEAK_NodeMap_FindNode(m_backendHandle, name.c_str(), name.size() + 1, &nodeHandle)
124 {
125 return false;
126 }
127
128 return std::dynamic_pointer_cast<NodeType>(m_nodesByName.at(name)) != nullptr;
129 }
130
144 std::shared_ptr<nodes::Node> FindNode(const std::string& name);
145
160 template <class NodeType, typename std::enable_if<std::is_base_of<nodes::Node, NodeType>::value, int>::type = 0>
161 std::shared_ptr<NodeType> FindNode(const std::string& name)
162 {
163 auto castedNode = std::dynamic_pointer_cast<NodeType>(FindNode(name));
164 if (!castedNode)
165 {
166 throw InvalidCastException("Invalid node cast!");
167 }
168
169 return castedNode;
170 }
171
183 std::shared_ptr<nodes::Node> TryFindNode(const std::string& name);
184
197 template <class NodeType, typename std::enable_if<std::is_base_of<nodes::Node, NodeType>::value, int>::type = 0>
198 std::shared_ptr<NodeType> TryFindNode(const std::string& name)
199 {
200 auto node = TryFindNode(name);
201 if(node == nullptr)
202 {
203 return nullptr;
204 }
205
206 auto castedNode = std::dynamic_pointer_cast<NodeType>(node);
207 if (!castedNode)
208 {
209 throw InvalidCastException("Invalid node cast!");
210 }
211
212 return castedNode;
213 }
214
222 void InvalidateNodes();
223
233 void PollNodes(int64_t elapsedTime_ms);
234
244 std::vector<std::shared_ptr<nodes::Node>> Nodes() const;
245
256 bool HasBufferSupportedChunks(const std::shared_ptr<Buffer>& buffer) const;
257
271 void UpdateChunkNodes(const std::shared_ptr<Buffer>& buffer);
272
283 bool HasEventSupportedData(const std::unique_ptr<Event>& event) const;
284
298 void UpdateEventNodes(const std::unique_ptr<Event>& event);
299
315 void StoreToFile(const std::string& filePath) const;
316
332 void LoadFromFile(const std::string& filePath);
333
352 std::unique_ptr<ScopedNodeMapLock> Lock();
353
374 std::unique_ptr<ScopedNodeMapLock> TryLock();
375
386 {
387 return m_backendHandle;
388 }
389
390private:
391 std::shared_ptr<nodes::Node> NodeFromHandle(PEAK_NODE_HANDLE nodeHandle) const;
392
393 friend ClassCreator<NodeMap>;
394 explicit NodeMap(PEAK_NODE_MAP_HANDLE nodeMapHandle);
395 PEAK_NODE_MAP_HANDLE m_backendHandle;
396
397 void Initialize() const override;
398 mutable std::vector<std::shared_ptr<nodes::Node>> m_nodes;
399 mutable std::unordered_map<std::string, std::shared_ptr<nodes::Node>> m_nodesByName;
400};
401
402} /* namespace core */
403} /* namespace peak */
404
415
416
417/* Implementation */
418namespace peak
419{
420namespace core
421{
422
423inline NodeMap::NodeMap(PEAK_NODE_MAP_HANDLE nodeMapHandle)
424 : m_backendHandle(nodeMapHandle)
425 , m_nodes()
426 , m_nodesByName()
427{}
428
429inline bool NodeMap::HasNode(const std::string& name) const
430{
431 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasNode) {
432 return PEAK_C_ABI_PREFIX PEAK_NodeMap_GetHasNode(m_backendHandle, name.c_str(), name.size() + 1, hasNode);
433 }) > 0;
434}
435
436inline std::shared_ptr<nodes::Node> NodeMap::FindNode(const std::string& name)
437{
438 InitializeIfNecessary();
439
440 (void)QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* nodeHandle) {
442 m_backendHandle, name.c_str(), name.size() + 1, nodeHandle);
443 });
444
445 return m_nodesByName.at(name);
446}
447
448inline std::shared_ptr<nodes::Node> NodeMap::TryFindNode(const std::string& name)
449{
450 InitializeIfNecessary();
451
452 const auto cNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>([&](PEAK_NODE_HANDLE* nodeHandle) {
454 m_backendHandle, name.c_str(), name.size() + 1, nodeHandle);
455 });
456
457 if(cNodeHandle == nullptr)
458 {
459 return nullptr;
460 }
461
462 return m_nodesByName.at(name);
463}
464
466{
467 CallAndCheckCInterfaceFunction(
468 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_InvalidateNodes(m_backendHandle); });
469}
470
471inline void NodeMap::PollNodes(int64_t elapsedTime_ms)
472{
473 CallAndCheckCInterfaceFunction(
474 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_PollNodes(m_backendHandle, elapsedTime_ms); });
475}
476
477inline std::vector<std::shared_ptr<nodes::Node>> NodeMap::Nodes() const
478{
479 InitializeIfNecessary();
480
481 return m_nodes;
482}
483
484inline bool NodeMap::HasEventSupportedData(const std::unique_ptr<Event>& event) const
485{
486 if (event == nullptr)
487 {
488 throw InvalidArgumentException("The given event is a nullptr!");
489 }
490
491 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* hasSupportedData) {
493 m_backendHandle, event->m_backendHandle, hasSupportedData);
494 }) > 0;
495}
496
497inline void NodeMap::UpdateEventNodes(const std::unique_ptr<Event>& event)
498{
499 if (event == nullptr)
500 {
501 throw InvalidArgumentException("The given event is a nullptr!");
502 }
503
504 CallAndCheckCInterfaceFunction(
505 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_UpdateEventNodes(m_backendHandle, event->m_backendHandle); });
506}
507
508inline void NodeMap::StoreToFile(const std::string& filePath) const
509{
510 CallAndCheckCInterfaceFunction([&] {
511 return PEAK_C_ABI_PREFIX PEAK_NodeMap_StoreToFile(m_backendHandle, filePath.c_str(), filePath.size() + 1);
512 });
513}
514
515inline void NodeMap::LoadFromFile(const std::string& filePath)
516{
517 InitializeIfNecessary();
518
519 CallAndCheckCInterfaceFunction([&] {
521 m_backendHandle, filePath.c_str(), filePath.size() + 1);
522 });
523}
524
525inline NodeMap::ScopedNodeMapLock::ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap)
526 : m_nodeMap(nodeMap)
527{
528 CallAndCheckCInterfaceFunction(
529 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_Lock(m_nodeMap->m_backendHandle); });
530}
531
532inline NodeMap::ScopedNodeMapLock::ScopedNodeMapLock(const std::shared_ptr<NodeMap>& nodeMap, std::adopt_lock_t)
533 : m_nodeMap(nodeMap)
534{
535
536}
537
539{
540 CallAndCheckCInterfaceFunction(
541 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_Unlock(m_nodeMap->m_backendHandle); });
542}
543
544inline std::unique_ptr<NodeMap::ScopedNodeMapLock> NodeMap::Lock()
545{
546 return std::make_unique<ClassCreator<ScopedNodeMapLock>>(shared_from_this());
547}
548
549inline std::unique_ptr<NodeMap::ScopedNodeMapLock> NodeMap::TryLock()
550{
551 PEAK_BOOL8 locked{false};
552 CallAndCheckCInterfaceFunction(
553 [&] { return PEAK_C_ABI_PREFIX PEAK_NodeMap_TryLock(m_backendHandle, &locked); });
554
555 if (!locked)
556 {
557 return {};
558 }
559
560 return std::make_unique<ClassCreator<ScopedNodeMapLock>>(shared_from_this(), std::adopt_lock);
561}
562
563inline std::shared_ptr<nodes::Node> NodeMap::NodeFromHandle(PEAK_NODE_HANDLE nodeHandle) const
564{
565 auto nodeType = QueryNumericFromCInterfaceFunction<PEAK_NODE_TYPE>(
566 [&](PEAK_NODE_TYPE* _nodeType) { return PEAK_C_ABI_PREFIX PEAK_Node_GetType(nodeHandle, _nodeType); });
567
568 switch (nodeType)
569 {
571 auto integerNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_INTEGER_NODE_HANDLE>(
572 [&](PEAK_INTEGER_NODE_HANDLE* _integerNodeHandle) {
573 return PEAK_C_ABI_PREFIX PEAK_Node_ToIntegerNode(nodeHandle, _integerNodeHandle);
574 });
575
576 return std::make_shared<ClassCreator<nodes::IntegerNode>>(
577 integerNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
578 }
580 auto booleanNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_BOOLEAN_NODE_HANDLE>(
581 [&](PEAK_BOOLEAN_NODE_HANDLE* _booleanNodeHandle) {
582 return PEAK_C_ABI_PREFIX PEAK_Node_ToBooleanNode(nodeHandle, _booleanNodeHandle);
583 });
584
585 return std::make_shared<ClassCreator<nodes::BooleanNode>>(
586 booleanNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
587 }
589 auto commandNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_COMMAND_NODE_HANDLE>(
590 [&](PEAK_COMMAND_NODE_HANDLE* _commandNodeHandle) {
591 return PEAK_C_ABI_PREFIX PEAK_Node_ToCommandNode(nodeHandle, _commandNodeHandle);
592 });
593
594 return std::make_shared<ClassCreator<nodes::CommandNode>>(
595 commandNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
596 }
598 auto floatNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_FLOAT_NODE_HANDLE>(
599 [&](PEAK_FLOAT_NODE_HANDLE* _floatNodeHandle) {
600 return PEAK_C_ABI_PREFIX PEAK_Node_ToFloatNode(nodeHandle, _floatNodeHandle);
601 });
602
603 return std::make_shared<ClassCreator<nodes::FloatNode>>(
604 floatNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
605 }
607 auto stringNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_STRING_NODE_HANDLE>(
608 [&](PEAK_STRING_NODE_HANDLE* _stringNodeHandle) {
609 return PEAK_C_ABI_PREFIX PEAK_Node_ToStringNode(nodeHandle, _stringNodeHandle);
610 });
611
612 return std::make_shared<ClassCreator<nodes::StringNode>>(
613 stringNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
614 }
616 auto registerNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_REGISTER_NODE_HANDLE>(
617 [&](PEAK_REGISTER_NODE_HANDLE* _registerNodeHandle) {
618 return PEAK_C_ABI_PREFIX PEAK_Node_ToRegisterNode(nodeHandle, _registerNodeHandle);
619 });
620
621 return std::make_shared<ClassCreator<nodes::RegisterNode>>(
622 registerNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
623 }
625 auto categoryNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_CATEGORY_NODE_HANDLE>(
626 [&](PEAK_CATEGORY_NODE_HANDLE* _categoryNodeHandle) {
627 return PEAK_C_ABI_PREFIX PEAK_Node_ToCategoryNode(nodeHandle, _categoryNodeHandle);
628 });
629
630 return std::make_shared<ClassCreator<nodes::CategoryNode>>(
631 categoryNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
632 }
634 auto enumerationNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_ENUMERATION_NODE_HANDLE>(
635 [&](PEAK_ENUMERATION_NODE_HANDLE* _enumerationNodeHandle) {
636 return PEAK_C_ABI_PREFIX PEAK_Node_ToEnumerationNode(nodeHandle, _enumerationNodeHandle);
637 });
638
639 return std::make_shared<ClassCreator<nodes::EnumerationNode>>(
640 enumerationNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
641 }
643 auto enumerationEntryNodeHandle = QueryNumericFromCInterfaceFunction<PEAK_ENUMERATION_ENTRY_NODE_HANDLE>(
644 [&](PEAK_ENUMERATION_ENTRY_NODE_HANDLE* _enumerationEntryNodeHandle) {
646 nodeHandle, _enumerationEntryNodeHandle);
647 });
648
649 return std::make_shared<ClassCreator<nodes::EnumerationEntryNode>>(
650 enumerationEntryNodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
651 }
652 default: {
653 return std::make_shared<ClassCreator<nodes::Node>>(
654 nodeHandle, std::const_pointer_cast<core::NodeMap>(shared_from_this()));
655 }
656 }
657}
658
659inline void NodeMap::Initialize() const
660{
661 auto numNodes = QueryNumericFromCInterfaceFunction<size_t>([&](size_t* _numNodes) {
662 return PEAK_C_ABI_PREFIX PEAK_NodeMap_GetNumNodes(m_backendHandle, _numNodes);
663 });
664
665 for (size_t x = 0; x < numNodes; ++x)
666 {
667 auto nodeHandle = QueryNumericFromCInterfaceFunction<PEAK_NODE_HANDLE>(
668 [&](PEAK_NODE_HANDLE* _nodeHandle) {
669 return PEAK_C_ABI_PREFIX PEAK_NodeMap_GetNode(m_backendHandle, x, _nodeHandle);
670 });
671
672 auto node = NodeFromHandle(nodeHandle);
673
674 m_nodes.emplace_back(node);
675 m_nodesByName.emplace(node->Name(), node);
676 }
677}
678
679} /* namespace core */
680} /* namespace peak */
Represents a GenTL buffer module.
Definition peak_buffer.hpp:81
The exception thrown for passing an invalid argument to a function.
Definition peak_exception.hpp:74
The exception thrown for trying to apply an invalid cast.
Definition peak_exception.hpp:82
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:538
PEAK_NODE_MAP_HANDLE Handle() const
Get the backend handle.
Definition peak_node_map.hpp:385
std::shared_ptr< nodes::Node > FindNode(const std::string &name)
Find a node with the given name.
Definition peak_node_map.hpp:436
bool HasNode(const std::string &name) const
Checks whether the node map contains a node with the given name.
Definition peak_node_map.hpp:429
bool HasEventSupportedData(const std::unique_ptr< Event > &event) const
Checks if the Event contains data corresponding to the NodeMap.
Definition peak_node_map.hpp:484
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:508
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:118
NodeMap & operator=(const NodeMap &other)=delete
std::unique_ptr< ScopedNodeMapLock > Lock()
Locks a recursive mutex on the NodeMap.
Definition peak_node_map.hpp:544
NodeMap(const NodeMap &other)=delete
void PollNodes(int64_t elapsedTime_ms)
Polls all nodes having a polling time.
Definition peak_node_map.hpp:471
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:198
std::vector< std::shared_ptr< nodes::Node > > Nodes() const
Returns the nodes.
Definition peak_node_map.hpp:477
std::function< bool(const std::shared_ptr< const nodes::Node > &nodeToFilter)> NodeFilterFunction
Definition peak_node_map.hpp:65
void UpdateChunkNodes(const std::shared_ptr< Buffer > &buffer)
Updates chunk information in the NodeMap.
Definition peak_buffer.hpp:915
void InvalidateNodes()
Invalidates all nodes.
Definition peak_node_map.hpp:465
std::shared_ptr< NodeType > FindNode(const std::string &name)
Find a node with the given name and type.
Definition peak_node_map.hpp:161
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:515
bool HasBufferSupportedChunks(const std::shared_ptr< Buffer > &buffer) const
Checks if the Buffer contains chunks corresponding to the NodeMap.
Definition peak_buffer.hpp:902
std::unique_ptr< ScopedNodeMapLock > TryLock()
Locks a recursive mutex on the NodeMap.
Definition peak_node_map.hpp:549
NodeMap & operator=(NodeMap &&other)=delete
void UpdateEventNodes(const std::unique_ptr< Event > &event)
Updates event information in the NodeMap.
Definition peak_node_map.hpp:497
std::shared_ptr< nodes::Node > TryFindNode(const std::string &name)
Tries to find a node with the given name.
Definition peak_node_map.hpp:448
Represents a GenAPI boolean node.
Definition peak_boolean_node.hpp:33
Represents a GenAPI category node.
Definition peak_category_node.hpp:36
Represents a GenAPI command node.
Definition peak_command_node.hpp:34
Represents a GenAPI enumeration entry node.
Definition peak_enumeration_entry_node.hpp:36
Represents a GenAPI enumeration node.
Definition peak_enumeration_node.hpp:39
Represents a GenAPI float node.
Definition peak_float_node.hpp:46
Represents a GenAPI integer node.
Definition peak_integer_node.hpp:37
Represents a GenAPI node.
Definition peak_node.hpp:122
Represents a GenAPI register node.
Definition peak_register_node.hpp:38
Represents a GenAPI string node.
Definition peak_string_node.hpp:35
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:31
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_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