7#include "../../_cexports/c_gev_server.h"
9#include "../../global.hpp"
11#include "../_decl/decl_node.hpp"
12#include "../_decl/decl_node_map.hpp"
13#include "../_decl/decl_server.hpp"
15#include "../../_decl/decl_device.hpp"
17#include "../category_node.hpp"
18#include "../value_node.hpp"
27 std::map<String, NodePtr> nodes;
28 for (
const auto &entry : nodes_)
29 nodes[entry.first] =
Node(entry.first);
33 inline void NodeMap::FillNodeKeys()
35 std::size_t numNodes = 0;
36 auto resultNum = CVB_CALL_CAPI(GSNodeCount(Handle(), numNodes));
38 std::rethrow_exception(CvbException::FromCvbResult(resultNum,
"failed to get node count"));
40 for (std::size_t i = 0; i < numNodes; ++i)
42 size_t nameLength = 0;
43 auto resultNameLength = CVB_CALL_CAPI(GSNodeList(Handle(), i,
nullptr, nameLength));
44 if (resultNameLength < 0)
45 std::rethrow_exception(CvbException::FromCvbResult(resultNameLength,
"failed to get node name length"));
47 std::vector<char> buffer(
static_cast<size_t>(nameLength));
48 auto resultBuffer = CVB_CALL_CAPI(GSNodeList(Handle(), i, &buffer[0], nameLength));
50 std::rethrow_exception(CvbException::FromCvbResult(resultBuffer,
"failed to get node name"));
51 String keyString(buffer.begin(), buffer.end() - 1);
53 nodes_[keyString] = std::shared_ptr<class Node>();
59 throw std::runtime_error(
"key must not be empty");
61 throw std::runtime_error(
"node must not be null");
62 auto name = value->NameOnly();
64 throw std::runtime_error(
"key and value->NameOnly() must be equal");
67 return CExports::GSNAddNodeExTyped(value->Handle(),
static_cast<CExports::TGSNodeList
>(kind), key.data(),
72 value->SetNodeMap(std::const_pointer_cast<NodeMap>(shared_from_this()));
Basic GevServer node for device feature access.
Definition decl_node.hpp:34
std::map< String, NodePtr > Nodes() const
Get a dictionary contain all nodes of this node map.
Definition detail_node_map.hpp:105
Describes a GenICam Pixel Format Naming Convention (PFNC) compatible image memory buffer with possibl...
Definition decl_int_swiss_knife_node.hpp:11
std::shared_ptr< Node > NodePtr
Convenience shared pointer for Node.
Definition gevserver.hpp:32
@ String
Node is a string node (no reg).
Definition gevserver.hpp:168
NodeList
Node access.
Definition gevserver.hpp:249
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17