KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DB_READ_DELIVERY Class Reference

Hands rows from a worker job to a caller's sink and gives the caller the column labels. More...

#include <db_backend_support.h>

Public Member Functions

 DB_READ_DELIVERY (std::vector< std::string > &aLabels, const DB_ROW_SINK &aSink)
 
 DB_READ_DELIVERY (const DB_READ_DELIVERY &)=delete
 
DB_READ_DELIVERY & operator= (const DB_READ_DELIVERY &)=delete
 
const std::shared_ptr< std::vector< std::string > > & Labels () const
 The labels the job fills in.
 
const DB_ROW_SINK * Sink () const
 The sink to pass to the worker call.
 
void Finish ()
 Copies the labels out if no row did, after the call returned a result.
 
bool SinkThrew () const
 True if the caller's sink threw.
 

Static Public Member Functions

static std::string SinkFailureMessage ()
 The message for a read the caller's sink gave up on.
 

Private Attributes

std::vector< std::string > & m_labels
 
const DB_ROW_SINK & m_sink
 
std::shared_ptr< std::vector< std::string > > m_jobLabels
 
DB_ROW_SINK m_deliver
 
bool m_labelsCopied = false
 
bool m_sinkThrew = false
 

Detailed Description

Hands rows from a worker job to a caller's sink and gives the caller the column labels.

The job fills Labels() before its first row, so they are copied out when that row arrives or, for a read that returned no rows, by Finish().

Definition at line 72 of file db_backend_support.h.

Constructor & Destructor Documentation

◆ DB_READ_DELIVERY() [1/2]

DB_READ_DELIVERY::DB_READ_DELIVERY ( std::vector< std::string > & aLabels,
const DB_ROW_SINK & aSink )

Definition at line 56 of file db_backend_support.cpp.

References m_deliver, m_jobLabels, m_labels, m_labelsCopied, m_sink, and m_sinkThrew.

Referenced by DB_READ_DELIVERY(), and operator=().

◆ DB_READ_DELIVERY() [2/2]

DB_READ_DELIVERY::DB_READ_DELIVERY ( const DB_READ_DELIVERY & )
delete

References DB_READ_DELIVERY().

Member Function Documentation

◆ Finish()

void DB_READ_DELIVERY::Finish ( )

Copies the labels out if no row did, after the call returned a result.

Definition at line 82 of file db_backend_support.cpp.

References m_jobLabels, m_labels, and m_labelsCopied.

Referenced by ACE_BACKEND::readPass(), and SQLITE_BACKEND::ReadTable().

◆ Labels()

const std::shared_ptr< std::vector< std::string > > & DB_READ_DELIVERY::Labels ( ) const
inline

The labels the job fills in.

Definition at line 81 of file db_backend_support.h.

References m_jobLabels.

Referenced by ACE_BACKEND::readPass(), and SQLITE_BACKEND::ReadTable().

◆ operator=()

DB_READ_DELIVERY & DB_READ_DELIVERY::operator= ( const DB_READ_DELIVERY & )
delete

References DB_READ_DELIVERY().

◆ Sink()

const DB_ROW_SINK * DB_READ_DELIVERY::Sink ( ) const
inline

The sink to pass to the worker call.

Definition at line 84 of file db_backend_support.h.

References m_deliver.

Referenced by ACE_BACKEND::readPass(), and SQLITE_BACKEND::ReadTable().

◆ SinkFailureMessage()

std::string DB_READ_DELIVERY::SinkFailureMessage ( )
static

The message for a read the caller's sink gave up on.

Definition at line 89 of file db_backend_support.cpp.

References _, and utf8().

Referenced by ACE_BACKEND::readPass(), and SQLITE_BACKEND::ReadTable().

◆ SinkThrew()

bool DB_READ_DELIVERY::SinkThrew ( ) const
inline

True if the caller's sink threw.

Definition at line 90 of file db_backend_support.h.

References m_sinkThrew.

Referenced by ACE_BACKEND::readPass(), and SQLITE_BACKEND::ReadTable().

Member Data Documentation

◆ m_deliver

DB_ROW_SINK DB_READ_DELIVERY::m_deliver
private

Definition at line 99 of file db_backend_support.h.

Referenced by DB_READ_DELIVERY(), and Sink().

◆ m_jobLabels

std::shared_ptr<std::vector<std::string> > DB_READ_DELIVERY::m_jobLabels
private

Definition at line 98 of file db_backend_support.h.

Referenced by DB_READ_DELIVERY(), Finish(), and Labels().

◆ m_labels

std::vector<std::string>& DB_READ_DELIVERY::m_labels
private

Definition at line 96 of file db_backend_support.h.

Referenced by DB_READ_DELIVERY(), and Finish().

◆ m_labelsCopied

bool DB_READ_DELIVERY::m_labelsCopied = false
private

Definition at line 100 of file db_backend_support.h.

Referenced by DB_READ_DELIVERY(), and Finish().

◆ m_sink

const DB_ROW_SINK& DB_READ_DELIVERY::m_sink
private

Definition at line 97 of file db_backend_support.h.

Referenced by DB_READ_DELIVERY().

◆ m_sinkThrew

bool DB_READ_DELIVERY::m_sinkThrew = false
private

Definition at line 101 of file db_backend_support.h.

Referenced by DB_READ_DELIVERY(), and SinkThrew().


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