diff options
author | Michael Shepanski <michael@codesynthesis.com> | 2014-10-30 15:10:56 +1100 |
---|---|---|
committer | Michael Shepanski <michael@codesynthesis.com> | 2014-10-30 15:28:05 +1100 |
commit | 3daba7d9d24c5fb85e2ee8c21b23b31efb8b278c (patch) | |
tree | e16ecd6a686a93b2efbae08f96ad744d892ed89f /doc | |
parent | 65485663ce42b92f3f4f1ea62910fd91d8ec7b29 (diff) |
Allow lambdas & std::functions as query factories with C++-98 builds of libodb
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.xhtml | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/doc/manual.xhtml b/doc/manual.xhtml index 13203f0..dd03def 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -12605,46 +12605,74 @@ namespace odb schema_version = 0, const std::string& name = ""); - // C++98/03 version: + typedef void data_migration_function_type (database&); + + // Common (for all the databases) data migration, C++98/03 version: // - typedef void (*data_migration_function_type) (database&); + template <schema_version v, schema_version base> + static void + data_migration_function (data_migration_function_type*, + const std::string& name = ""); - // C++11 version: + // Common (for all the databases) data migration, C++11 version: // - typedef std::function<void (database&)> data_migration_function_type; + template <schema_version v, schema_version base> + static void + data_migration_function (std::function<data_migration_function_type>, + const std::string& name = ""); - // Common (for all the databases) data migration. + // Database-specific data migration, C++98/03 version: // template <schema_version v, schema_version base> static void - data_migration_function (data_migration_function_type, + data_migration_function (database&, + data_migration_function_type*, const std::string& name = ""); - // Database-specific data migration. + template <schema_version v, schema_version base> + static void + data_migration_function (database_id, + data_migration_function_type*, + const std::string& name = ""); + + // Database-specific data migration, C++11 version: // template <schema_version v, schema_version base> static void data_migration_function (database&, - data_migration_function_type, + std::function<data_migration_function_type>, const std::string& name = ""); template <schema_version v, schema_version base> static void data_migration_function (database_id, - data_migration_function_type, + std::function<data_migration_function_type>, const std::string& name = ""); }; - // Static data migration function registration. + // Static data migration function registration, C++98/03 version: + // + template <schema_version v, schema_version base> + struct data_migration_entry + { + data_migration_entry (data_migration_function_type*, + const std::string& name = ""); + + data_migration_entry (database_id, + data_migration_function_type*, + const std::string& name = ""); + }; + + // Static data migration function registration, C++11 version: // template <schema_version v, schema_version base> struct data_migration_entry { - data_migration_entry (data_migration_function_type, + data_migration_entry (std::function<data_migration_function_type>, const std::string& name = ""); data_migration_entry (database_id, - data_migration_function_type, + std::function<data_migration_function_type>, const std::string& name = ""); }; } |