Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
A few unclassified updates
Browse files Browse the repository at this point in the history
  • Loading branch information
trueqbit committed Jun 6, 2022
1 parent 9e7cd8f commit 5e98da9
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
6 changes: 3 additions & 3 deletions dev/mapped_row_extractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ namespace sqlite_orm {
* V is value type just like regular `row_extractor` has
* T is table info class `table_t`
*/
template<class V, class T>
template<class V, class Table>
struct mapped_row_extractor {
using table_info_t = T;
using table_type = Table;

V extract(sqlite3_stmt* stmt, int /*columnIndex*/) const {
V res;
Expand All @@ -27,7 +27,7 @@ namespace sqlite_orm {
return res;
}

const table_info_t& tableInfo;
const table_type& tableInfo;
};

}
Expand Down
9 changes: 3 additions & 6 deletions dev/node_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ namespace sqlite_orm {
namespace internal {

template<class T, class SFINAE = void>
struct node_tuple;

template<class T>
using node_tuple_t = typename node_tuple<T>::type;

template<class T, class SFINAE>
struct node_tuple {
using type = std::tuple<T>;
};

template<class T>
using node_tuple_t = typename node_tuple<T>::type;

template<>
struct node_tuple<void, void> {
using type = std::tuple<>;
Expand Down
6 changes: 3 additions & 3 deletions dev/row_extractor_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ namespace sqlite_orm {
return {};
}

template<class T, class I>
mapped_row_extractor<T, I> make_row_extractor(const I* tableInfo) {
return {*tableInfo};
template<class T, class Table>
mapped_row_extractor<T, Table> make_row_extractor(const Table* table) {
return {*table};
}
}

Expand Down
10 changes: 10 additions & 0 deletions dev/storage_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ namespace sqlite_orm {
namespace internal {

/**
* SFINAE friendly facility to pick a table definition (`table_t`) from a tuple of database objects.
*
* DBOs - db_objects_tuple type
* Lookup - mapped data type
*/
Expand All @@ -67,13 +69,18 @@ namespace sqlite_orm {
#endif

/**
* SFINAE friendly facility to pick a table definition (`table_t`) from a tuple of database objects.
*
* DBOs - db_objects_tuple type, possibly const-qualified
* Lookup - 'table' type, mapped data type
*/
template<class Lookup, class DBOs>
using storage_pick_table_t = typename storage_pick_table<Lookup, std::remove_const_t<DBOs>>::type;

/**
* Find a table definition (`table_t`) from a tuple of database objects;
* `std::nonesuch` if not found.
*
* DBOs - db_objects_tuple type
* Lookup - mapped data type
*/
Expand All @@ -89,6 +96,9 @@ namespace sqlite_orm {
#endif

/**
* Find a table definition (`table_t`) from a tuple of database objects;
* `std::nonesuch` if not found.
*
* DBOs - db_objects_tuple type, possibly const-qualified
* Lookup - mapped data type
*/
Expand Down
31 changes: 19 additions & 12 deletions include/sqlite_orm/sqlite_orm.h
Original file line number Diff line number Diff line change
Expand Up @@ -9135,6 +9135,8 @@ namespace sqlite_orm {
namespace internal {

/**
* SFINAE friendly facility to pick a table definition (`table_t`) from a tuple of database objects.
*
* DBOs - db_objects_tuple type
* Lookup - mapped data type
*/
Expand All @@ -9150,13 +9152,18 @@ namespace sqlite_orm {
#endif

/**
* SFINAE friendly facility to pick a table definition (`table_t`) from a tuple of database objects.
*
* DBOs - db_objects_tuple type, possibly const-qualified
* Lookup - 'table' type, mapped data type
*/
template<class Lookup, class DBOs>
using storage_pick_table_t = typename storage_pick_table<Lookup, std::remove_const_t<DBOs>>::type;

/**
* Find a table definition (`table_t`) from a tuple of database objects;
* `std::nonesuch` if not found.
*
* DBOs - db_objects_tuple type
* Lookup - mapped data type
*/
Expand All @@ -9172,6 +9179,9 @@ namespace sqlite_orm {
#endif

/**
* Find a table definition (`table_t`) from a tuple of database objects;
* `std::nonesuch` if not found.
*
* DBOs - db_objects_tuple type, possibly const-qualified
* Lookup - mapped data type
*/
Expand Down Expand Up @@ -10535,9 +10545,9 @@ namespace sqlite_orm {
* V is value type just like regular `row_extractor` has
* T is table info class `table_t`
*/
template<class V, class T>
template<class V, class Table>
struct mapped_row_extractor {
using table_info_t = T;
using table_type = Table;

V extract(sqlite3_stmt* stmt, int /*columnIndex*/) const {
V res;
Expand All @@ -10546,7 +10556,7 @@ namespace sqlite_orm {
return res;
}

const table_info_t& tableInfo;
const table_type& tableInfo;
};

}
Expand All @@ -10562,9 +10572,9 @@ namespace sqlite_orm {
return {};
}

template<class T, class I>
mapped_row_extractor<T, I> make_row_extractor(const I* tableInfo) {
return {*tableInfo};
template<class T, class Table>
mapped_row_extractor<T, Table> make_row_extractor(const Table* table) {
return {*table};
}
}

Expand Down Expand Up @@ -18343,16 +18353,13 @@ namespace sqlite_orm {
namespace internal {

template<class T, class SFINAE = void>
struct node_tuple;

template<class T>
using node_tuple_t = typename node_tuple<T>::type;

template<class T, class SFINAE>
struct node_tuple {
using type = std::tuple<T>;
};

template<class T>
using node_tuple_t = typename node_tuple<T>::type;

template<>
struct node_tuple<void, void> {
using type = std::tuple<>;
Expand Down

0 comments on commit 5e98da9

Please sign in to comment.