CVB++ 15.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 CVB_BEGIN_INLINE_NS
13
14 namespace GenApi
15 {
16
18
22 class PortNode : public Node
23 {
24 public:
25 explicit PortNode(HandleGuard<Node> &&guard) noexcept
26 : Node(std::move(guard))
27 {
28 }
29
31
40 void Read(std::int64_t address, void *buffer, size_t bufferLenght) const
41 {
42 NativeCall([&]() {
43 return CExports::NGetAsMemory(Handle(), static_cast<CExports::cvbint64_t>(address), buffer, bufferLenght);
44 });
45 }
46
48
56 void Write(std::int64_t address, const void *buffer, size_t bufferLenght)
57 {
58 NativeCall([&]() {
59 return CExports::NSetAsMemory(Handle(), static_cast<CExports::cvbint64_t>(address), buffer, bufferLenght);
60 });
61 }
62 };
63
64 } // namespace GenApi
65
66 using GenApi::PortNode;
67
68 CVB_END_INLINE_NS
69
70} // namespace Cvb
void * Handle() const noexcept
Classic API node handle.
Definition decl_node.hpp:69
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:56
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:40
T move(T... args)
Namespace for GenApi based device configuration.
Definition decl_fw_updater.hpp:29
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17