![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Represents a binary data object within the protocol. More...
#include <binary.hpp>
Public Member Functions | |
IRSOL_STATIC_ASSERT ((NBytes==1||NBytes==2), "Binary data element byte size must be 1 or 2") | |
IRSOL_STATIC_ASSERT (N >=1, "Binary data dimensionality must be at least 1") | |
BinaryData (std::vector< irsol::types::byte_t > &&data, const std::array< uint64_t, N > &shape, std::vector< BinaryDataAttribute > &&attributes={}) | |
Constructs a BinaryData object. | |
BinaryData (BinaryData &&other)=default | |
Move constructs a BinaryData object. | |
BinaryData (const BinaryData &)=delete | |
BinaryData & | operator= (const BinaryData &)=delete |
BinaryData & | operator= (BinaryData &&other) noexcept=delete |
std::string | toString () const |
Returns a string summary of the binary data buffer. | |
Public Attributes | |
std::vector< irsol::types::byte_t > | data |
Owned binary data bytes. | |
std::array< uint64_t, DIM > | shape |
Shape of the binary data. | |
uint64_t | numElements |
Total number of elements in the data. | |
uint64_t | numBytes |
Total number of bytes (numElements * bytes per element). | |
std::vector< BinaryDataAttribute > | attributes |
Additional attributes related to the binary data. | |
Static Public Attributes | |
static constexpr uint8_t | BYTES_PER_ELEMENT = NBytes |
Number of bytes per element. | |
static constexpr uint8_t | DIM = N |
Dimensionality of the binary data. | |
Represents a binary data object within the protocol.
This class owns a contiguous block of binary data elements and their shape, along with optional additional attributes. It supports only move semantics to avoid unnecessary copies of potentially large data buffers.
NBytes | Number of bytes per element (e.g., 1 for 8-bit data, 2 for 16-bit). |
N | Dimensionality of the binary data (e.g., 2 for images). |
Definition at line 106 of file binary.hpp.
|
inline |
Constructs a BinaryData object.
data | Rvalue reference to the binary data bytes; ownership is transferred. |
shape | Shape of the data as an array of size N. |
attributes | Optional additional attributes; ownership is transferred. |
irsol::AssertException | if the data size does not match shape * bytes per element. |
Definition at line 125 of file binary.hpp.
|
default |
Move constructs a BinaryData object.
other | The object to move from. |
|
delete |
irsol::protocol::internal::BinaryData< NBytes, N >::IRSOL_STATIC_ASSERT | ( | (NBytes==1||NBytes==2) | , |
"Binary data element byte size must be 1 or 2" | |||
) |
irsol::protocol::internal::BinaryData< NBytes, N >::IRSOL_STATIC_ASSERT | ( | N >= | 1, |
"Binary data dimensionality must be at least 1" | |||
) |
|
deletenoexcept |
|
delete |
|
inline |
Returns a string summary of the binary data buffer.
Definition at line 177 of file binary.hpp.
std::vector<BinaryDataAttribute> irsol::protocol::internal::BinaryData< NBytes, N >::attributes |
Additional attributes related to the binary data.
Definition at line 171 of file binary.hpp.
|
staticconstexpr |
Number of bytes per element.
Definition at line 112 of file binary.hpp.
std::vector<irsol::types::byte_t> irsol::protocol::internal::BinaryData< NBytes, N >::data |
Owned binary data bytes.
Definition at line 159 of file binary.hpp.
|
staticconstexpr |
Dimensionality of the binary data.
Definition at line 115 of file binary.hpp.
uint64_t irsol::protocol::internal::BinaryData< NBytes, N >::numBytes |
Total number of bytes (numElements * bytes per element).
Definition at line 168 of file binary.hpp.
uint64_t irsol::protocol::internal::BinaryData< NBytes, N >::numElements |
Total number of elements in the data.
Definition at line 165 of file binary.hpp.
std::array<uint64_t, DIM> irsol::protocol::internal::BinaryData< NBytes, N >::shape |
Shape of the binary data.
Definition at line 162 of file binary.hpp.