GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
write_objects_t Struct Reference

Data-passing struct for callbacks to qof_object_foreach() used in GncSqlObjectBackend::write(). More...

#include <gnc-sql-object-backend.hpp>

Inheritance diagram for write_objects_t:
split_info_t

Public Member Functions

 write_objects_t (GncSqlBackend *sql_be, bool o, GncSqlObjectBackend *e)
 
void commit (QofInstance *inst)
 

Data Fields

GncSqlBackendbe = nullptr
 
bool is_ok = false
 
GncSqlObjectBackendobe = nullptr
 

Detailed Description

Data-passing struct for callbacks to qof_object_foreach() used in GncSqlObjectBackend::write().

Once QofCollection is rewritten to use C++ containers we'll use std::foreach() and lambdas instead of callbacks and this can go away.

Definition at line 124 of file gnc-sql-object-backend.hpp.

Constructor & Destructor Documentation

◆ write_objects_t()

write_objects_t::write_objects_t ( GncSqlBackend sql_be,
bool  o,
GncSqlObjectBackend e 
)
inline

Definition at line 127 of file gnc-sql-object-backend.hpp.

127 :
128 be{sql_be}, is_ok{o}, obe{e} {}

Member Function Documentation

◆ commit()

void write_objects_t::commit ( QofInstance inst)
inline

Definition at line 129 of file gnc-sql-object-backend.hpp.

129 {
130 if (is_ok) is_ok = obe->commit (be, inst);
131 }
virtual bool commit(GncSqlBackend *sql_be, QofInstance *inst)
UPDATE/INSERT a single instance of m_type_name into the database.

Field Documentation

◆ be

GncSqlBackend* write_objects_t::be = nullptr

Definition at line 132 of file gnc-sql-object-backend.hpp.

◆ is_ok

bool write_objects_t::is_ok = false

Definition at line 133 of file gnc-sql-object-backend.hpp.

◆ obe

GncSqlObjectBackend* write_objects_t::obe = nullptr

Definition at line 134 of file gnc-sql-object-backend.hpp.


The documentation for this struct was generated from the following file: