|
KiCad PCB EDA Suite
|
What a job running on a DB_WORKER_THREAD uses to hand rows to the caller. More...
#include <db_worker_thread.h>
Public Member Functions | |
| bool | Emit (std::vector< DB_VALUE > &&aRow) |
| Queues a row for the caller's sink. | |
| bool | Flush () |
| Delivers the rows still held back and waits until the caller's sink has taken every one. | |
| bool | Cancelled () const |
Static Public Attributes | |
| static constexpr size_t | BATCH_ROWS = 512 |
| static constexpr size_t | MAX_QUEUED_BATCHES = 4 |
Private Member Functions | |
| DB_JOB_CONTEXT (DB_WORKER_CORE &aCore) | |
| bool | pushBatch () |
Private Attributes | |
| DB_WORKER_CORE & | m_core |
| std::vector< std::vector< DB_VALUE > > | m_pending |
Friends | |
| struct | DB_WORKER_CORE |
What a job running on a DB_WORKER_THREAD uses to hand rows to the caller.
Rows are grouped in batches of BATCH_ROWS, and at most MAX_QUEUED_BATCHES wait for the caller at once, so a table is never copied in full.
Definition at line 43 of file db_worker_thread.h.
|
inlineexplicitprivate |
Definition at line 69 of file db_worker_thread.h.
References DB_WORKER_CORE, and m_core.
| bool DB_JOB_CONTEXT::Cancelled | ( | ) | const |
Definition at line 256 of file db_worker_thread.cpp.
References m_core.
Referenced by Emit(), Flush(), and pushBatch().
| bool DB_JOB_CONTEXT::Emit | ( | std::vector< DB_VALUE > && | aRow | ) |
Queues a row for the caller's sink.
Blocks while the caller is behind.
Definition at line 288 of file db_worker_thread.cpp.
References BATCH_ROWS, Cancelled(), m_pending, and pushBatch().
Referenced by SQLITE_BACKEND::ReadTable().
| bool DB_JOB_CONTEXT::Flush | ( | ) |
Delivers the rows still held back and waits until the caller's sink has taken every one.
A job commits only after this returns true.
Definition at line 299 of file db_worker_thread.cpp.
References Cancelled(), m_core, m_pending, and pushBatch().
Referenced by SQLITE_BACKEND::ReadTable().
|
private |
Definition at line 262 of file db_worker_thread.cpp.
References BATCH_ROWS, Cancelled(), m_core, m_pending, and MAX_QUEUED_BATCHES.
Referenced by Emit(), Flush(), and DB_WORKER_CORE::Main().
|
friend |
Definition at line 67 of file db_worker_thread.h.
References DB_WORKER_CORE.
Referenced by DB_JOB_CONTEXT(), and DB_WORKER_CORE.
|
staticconstexpr |
Definition at line 46 of file db_worker_thread.h.
Referenced by Emit(), and pushBatch().
|
private |
Definition at line 73 of file db_worker_thread.h.
Referenced by Cancelled(), DB_JOB_CONTEXT(), Flush(), and pushBatch().
|
private |
Definition at line 74 of file db_worker_thread.h.
Referenced by Emit(), Flush(), DB_WORKER_CORE::Main(), and pushBatch().
|
staticconstexpr |
Definition at line 47 of file db_worker_thread.h.
Referenced by pushBatch().