drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
xa_storage_engine.cc
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems, Inc.
5 * Copyright (C) 2010 Jay Pipes <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <config.h>
22
24
26#include <drizzled/session.h>
27#include <drizzled/error.h>
28#include <drizzled/gettext.h>
29#include <drizzled/plugin/xa_storage_engine.h>
30#include <drizzled/xid.h>
31
32#include <string>
33#include <vector>
34#include <algorithm>
35#include <functional>
36
37namespace drizzled
38{
39
40namespace plugin
41{
42
43static std::vector<XaStorageEngine *> vector_of_xa_engines;
44
45XaStorageEngine::XaStorageEngine(const std::string &name_arg,
46 const std::bitset<HTON_BIT_SIZE> &flags_arg) :
47 TransactionalStorageEngine(name_arg, flags_arg)
48{}
49
50XaStorageEngine::~XaStorageEngine()
51{}
52
53bool XaStorageEngine::addPlugin(XaStorageEngine &engine)
54{
55 vector_of_xa_engines.push_back(&engine);
56
57 return TransactionalStorageEngine::addPlugin(engine) &&
58 XaResourceManager::addPlugin(engine);
59}
60
61void XaStorageEngine::removePlugin(XaStorageEngine &engine)
62{
63 vector_of_xa_engines.clear();
64 TransactionalStorageEngine::removePlugin(engine);
65 XaResourceManager::removePlugin(engine);
66}
67
68} /* namespace plugin */
69} /* namespace drizzled */
Defines the interface to the CachedDirectory class.
TODO: Rename this file - func.h is stupid.