fb-cpp 0.0.2
A modern C++ wrapper for the Firebird database API
Loading...
Searching...
No Matches
fbcpp::Array Class Referencefinal

Provides slice access to a Firebird array. More...

#include <Array.h>

Public Member Functions

 Array (Attachment &attachment, Transaction &transaction, ArrayDescriptor descriptor, ArrayId id={})
 Creates an array helper for a new array or an existing array identifier.
 
 Array (const Array &)=delete
 
Arrayoperator= (const Array &)=delete
 
 Array (Array &&)=delete
 
Arrayoperator= (Array &&)=delete
 
const ArrayIdgetId () const noexcept
 Returns the current array identifier.
 
const ArrayDescriptorgetDescriptor () const noexcept
 Returns the descriptor used for slice operations.
 
std::size_t getSliceLength () const
 Returns the exact number of bytes in a complete array slice.
 
unsigned read (std::span< std::byte > buffer)
 Reads the complete array slice into Firebird-format bytes.
 
void write (std::span< const std::byte > buffer)
 Writes the complete array slice from Firebird-format bytes.
 
template<typename T , std::size_t Extent>
requires (!std::is_same_v<std::remove_cv_t<T>, std::byte>)
unsigned read (std::span< T, Extent > buffer)
 Reads the complete array slice into elements matching the Firebird element representation.
 
template<typename T , std::size_t Extent>
requires (!std::is_same_v<std::remove_cv_t<T>, std::byte>)
void write (std::span< const T, Extent > buffer)
 Writes the complete array slice from elements matching the Firebird element representation.
 

Detailed Description

Provides slice access to a Firebird array.

Definition at line 103 of file Array.h.

Constructor & Destructor Documentation

◆ Array()

Array::Array ( Attachment attachment,
Transaction transaction,
ArrayDescriptor  descriptor,
ArrayId  id = {} 
)

Creates an array helper for a new array or an existing array identifier.

Definition at line 104 of file Array.cpp.

Member Function Documentation

◆ getDescriptor()

const ArrayDescriptor & fbcpp::Array::getDescriptor ( ) const
inlinenoexcept

Returns the descriptor used for slice operations.

Definition at line 122 of file Array.h.

◆ getId()

const ArrayId & fbcpp::Array::getId ( ) const
inlinenoexcept

Returns the current array identifier.

Definition at line 116 of file Array.h.

◆ getSliceLength()

std::size_t Array::getSliceLength ( ) const

Returns the exact number of bytes in a complete array slice.

Definition at line 115 of file Array.cpp.

◆ read() [1/2]

unsigned Array::read ( std::span< std::byte >  buffer)

Reads the complete array slice into Firebird-format bytes.

Definition at line 132 of file Array.cpp.

◆ read() [2/2]

template<typename T , std::size_t Extent>
requires (!std::is_same_v<std::remove_cv_t<T>, std::byte>)
unsigned fbcpp::Array::read ( std::span< T, Extent >  buffer)
inline

Reads the complete array slice into elements matching the Firebird element representation.

Definition at line 139 of file Array.h.

◆ write() [1/2]

void Array::write ( std::span< const std::byte >  buffer)

Writes the complete array slice from Firebird-format bytes.

Definition at line 155 of file Array.cpp.

◆ write() [2/2]

template<typename T , std::size_t Extent>
requires (!std::is_same_v<std::remove_cv_t<T>, std::byte>)
void fbcpp::Array::write ( std::span< const T, Extent >  buffer)
inline

Writes the complete array slice from elements matching the Firebird element representation.

Definition at line 148 of file Array.h.


The documentation for this class was generated from the following files: