CVB++ 14.0
port_node.hpp
1#pragma once
2
3#include "../_cexports/c_gen_api.h"
4
5#include "../global.hpp"
6
7#include "_decl/decl_node.hpp"
8
9namespace Cvb
10{
11
12
13
14CVB_BEGIN_INLINE_NS
15
16namespace GenApi
17{
18
20
25 : public Node
26{
27 public:
28
29 PortNode(HandleGuard<Node>&& guard) noexcept
30 : Node(std::move(guard))
31 {
32 }
33
35
43 void Read(std::int64_t address, void* buffer, size_t bufferLenght) const
44 {
45 NativeCall([&]()
46 {
47 return CExports::NGetAsMemory(Handle(), static_cast<CExports::cvbint64_t>(address), buffer, bufferLenght);
48 });
49 }
50
52
60 void Write(std::int64_t address, const void* buffer, size_t bufferLenght)
61 {
62 NativeCall([&]()
63 {
64 return CExports::NSetAsMemory(Handle(), static_cast<CExports::cvbint64_t>(address), buffer, bufferLenght);
65 });
66 }
67};
68
69
70}
71
72using GenApi::PortNode;
73
74CVB_END_INLINE_NS
75
76}
Basic GenApi node for device feature access.
Definition: decl_node.hpp:39
void * Handle() const noexcept
Classic API node handle.
Definition: decl_node.hpp:56
Port nodes are the connection to the remote device.
Definition: port_node.hpp:26
void Write(std::int64_t address, const void *buffer, size_t bufferLenght)
Writes memory from the given buffer to the remote device.
Definition: port_node.hpp:60
void Read(std::int64_t address, void *buffer, size_t bufferLenght) const
Reads memory from the remote device into the given buffer.
Definition: port_node.hpp:43
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24