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

Wraps IBatchCompletionState to provide RAII-safe access to batch execution results. More...

#include <Batch.h>

Public Member Functions

 BatchCompletionState (Client &client, FbUniquePtr< fb::IBatchCompletionState > handle) noexcept
 Constructs a BatchCompletionState from a Firebird completion state handle.
 
 BatchCompletionState (BatchCompletionState &&o) noexcept
 Transfers ownership of another completion state into this one.
 
BatchCompletionStateoperator= (BatchCompletionState &&)=delete
 Move assignment is not supported.
 
 BatchCompletionState (const BatchCompletionState &)=delete
 Copy construction is not supported.
 
BatchCompletionStateoperator= (const BatchCompletionState &)=delete
 Copy assignment is not supported.
 
unsigned getSize ()
 Returns the number of messages processed.
 
int getState (unsigned pos)
 Returns the per-message result at the given position.
 
std::optional< unsigned > findError (unsigned pos)
 Finds the next error at or after the given position.
 
std::vector< std::intptr_t > getStatus (unsigned pos)
 Returns the detailed error status vector for the given position.
 

Static Public Attributes

static constexpr int EXECUTE_FAILED = fb::IBatchCompletionState::EXECUTE_FAILED
 Per-message state value indicating the message failed to execute.
 
static constexpr int SUCCESS_NO_INFO = fb::IBatchCompletionState::SUCCESS_NO_INFO
 Per-message state value indicating success with no row-count information.
 

Detailed Description

Wraps IBatchCompletionState to provide RAII-safe access to batch execution results.

This is a move-only type. The underlying Firebird handle is disposed in the destructor.

Definition at line 185 of file Batch.h.

Constructor & Destructor Documentation

◆ BatchCompletionState() [1/2]

BatchCompletionState::BatchCompletionState ( Client client,
FbUniquePtr< fb::IBatchCompletionState >  handle 
)
explicitnoexcept

Constructs a BatchCompletionState from a Firebird completion state handle.

Definition at line 37 of file Batch.cpp.

◆ BatchCompletionState() [2/2]

BatchCompletionState::BatchCompletionState ( BatchCompletionState &&  o)
noexcept

Transfers ownership of another completion state into this one.

Definition at line 45 of file Batch.cpp.

Member Function Documentation

◆ findError()

std::optional< unsigned > BatchCompletionState::findError ( unsigned  pos)

Finds the next error at or after the given position.

Returns std::nullopt when there are no more errors.

Definition at line 63 of file Batch.cpp.

◆ getSize()

unsigned BatchCompletionState::getSize ( )

Returns the number of messages processed.

Definition at line 53 of file Batch.cpp.

◆ getState()

int BatchCompletionState::getState ( unsigned  pos)

Returns the per-message result at the given position.

The value is either the number of affected rows, EXECUTE_FAILED, or SUCCESS_NO_INFO.

Definition at line 58 of file Batch.cpp.

◆ getStatus()

std::vector< std::intptr_t > BatchCompletionState::getStatus ( unsigned  pos)

Returns the detailed error status vector for the given position.

The returned vector has the same format as IStatus::getErrors().

Definition at line 73 of file Batch.cpp.

Member Data Documentation

◆ EXECUTE_FAILED

constexpr int fbcpp::BatchCompletionState::EXECUTE_FAILED = fb::IBatchCompletionState::EXECUTE_FAILED
staticconstexpr

Per-message state value indicating the message failed to execute.

Definition at line 191 of file Batch.h.

◆ SUCCESS_NO_INFO

constexpr int fbcpp::BatchCompletionState::SUCCESS_NO_INFO = fb::IBatchCompletionState::SUCCESS_NO_INFO
staticconstexpr

Per-message state value indicating success with no row-count information.

Definition at line 196 of file Batch.h.


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