/
factory.cpp
45 lines (35 loc) · 1020 Bytes
/
factory.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton
// MySQL backend copyright (C) 2006 Pawel Aleksander Fedorynski
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#define SOCI_MYSQL_SOURCE
#include "soci-mysql.h"
#include <backend-loader.h>
#include <ciso646>
#ifdef _MSC_VER
#pragma warning(disable:4355)
#endif
using namespace soci;
using namespace soci::details;
// concrete factory for MySQL concrete strategies
mysql_session_backend * mysql_backend_factory::make_session(
connection_parameters const & parameters) const
{
return new mysql_session_backend(parameters);
}
mysql_backend_factory const soci::mysql;
extern "C"
{
// for dynamic backend loading
SOCI_MYSQL_DECL backend_factory const * factory_mysql()
{
return &soci::mysql;
}
SOCI_MYSQL_DECL void register_factory_mysql()
{
soci::dynamic_backends::register_backend("mysql", soci::mysql);
}
} // extern "C"