Example #1
0
static void
create_tables(const OBEEntry& entry, GncDbiBackend* be)
{
    std::string type;
    GncSqlObjectBackendPtr obe = nullptr;
    std::tie(type, obe) = entry;
    g_return_if_fail(obe->is_version (GNC_SQL_BACKEND_VERSION));

    obe->create_tables (be);
}
Example #2
0
void
GncSqlBackend::ObjectBackendRegistry::load_remaining(GncSqlBackend* sql_be)
{

    for (auto entry : m_registry)
    {
        std::string type;
        GncSqlObjectBackendPtr obe = nullptr;
        std::tie(type, obe) = entry;

        /* Don't need to load anything if it has already been loaded with
         * the fixed order.
         */
        if (std::find(fixed_load_order.begin(), fixed_load_order.end(),
                      type) != fixed_load_order.end()) continue;
        if (std::find(business_fixed_load_order.begin(),
                      business_fixed_load_order.end(),
                      type) != business_fixed_load_order.end()) continue;

        obe->load_all (sql_be);
    }
}
Example #3
0
void
GncSqlBackend::ObjectBackendRegistry::register_backend(GncSqlObjectBackendPtr obe) noexcept
{
    m_registry.emplace_back(make_tuple(std::string{obe->type()}, obe));
}