CVB++ 14.0
buffer.hpp
1#pragma once
2
3#include "buffer_base.hpp"
4
5namespace Cvb
6{
7
8 CVB_BEGIN_INLINE_NS
9
11
12 class Buffer
13 : public BufferBase
14 {
15 struct PrivateTag {};
16
17 public:
18 Buffer(HandleGuard<BufferBase>&& guard, PrivateTag)
19 : BufferBase(std::move(guard))
20 {
21 if (!CVB_CALL_CAPI(CVCIsBuffer(Handle())))
22 throw std::runtime_error("buffer handle must be a buffer");
23 }
24
26
29 static BufferPtr FromHandle(HandleGuard<BufferBase>&& guard)
30 {
31 return std::make_shared<Buffer>(std::move(guard), PrivateTag{});
32 }
33 };
34
35 CVB_END_INLINE_NS
36
37}
Base class of all buffers.
Definition: buffer_base.hpp:22
void * Handle() const noexcept
Classic API buffer handle.
Definition: buffer_base.hpp:39
Buffer class implementing a buffer.
Definition: buffer.hpp:14
static BufferPtr FromHandle(HandleGuard< BufferBase > &&guard)
Creates a buffer from a classic API handle.
Definition: buffer.hpp:29
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24