/
UCS
/
sqlite_orm
Обзор
Документация
Войти
/
UCS
/
sqlite_orm
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
dev/mapped_row_extractor.h
35 строк
1 KB
klaus triendl
A few unclassified updates
06 июн 2022, 13:24
06 июн 2022, 13:24
5e98da9
Код
Авторство
О чём код?
#pragma once #include <sqlite3.h> #include "object_from_column_builder.h" namespace sqlite_orm { namespace internal { /** * This is a private row extractor class. It is used for extracting rows as objects instead of tuple. * Main difference from regular `row_extractor` is that this class takes table info which is required * for constructing objects by member pointers. To construct please use `make_row_extractor()`. * Type arguments: * V is value type just like regular `row_extractor` has * T is table info class `table_t` */ template<class V, class Table> struct mapped_row_extractor { using table_type = Table; V extract(sqlite3_stmt* stmt, int /*columnIndex*/) const { V res; object_from_column_builder<V> builder{res, stmt}; this->tableInfo.for_each_column(builder); return res; } const table_type& tableInfo; }; } }