Drizzled Public API Documentation

resource_context.h
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 <jaypipes@gmail.com>
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 #pragma once
22 
23 #include <drizzled/common_fwd.h>
24 
25 namespace drizzled {
26 
43 {
44 public:
45  ResourceContext() :
46  monitored(NULL),
47  xa_resource_manager(NULL),
48  trx_storage_engine(NULL),
49  modified_data(false)
50  {}
51 
53  void reset();
54 
59  void markModifiedData();
60 
65  bool hasModifiedData() const;
66 
72  bool isStarted() const;
73 
77  void coalesceWith(const ResourceContext *stmt_trx);
78 
84  {
85  return monitored;
86  }
87 
92  {
93  monitored= in_monitored;
94  }
95 
101  {
102  return trx_storage_engine;
103  }
104 
109  {
110  trx_storage_engine= in_trx_storage_engine;
111  }
112 
118  {
119  return xa_resource_manager;
120  }
121 
125  void setXaResourceManager(plugin::XaResourceManager *in_xa_resource_manager)
126  {
127  xa_resource_manager= in_xa_resource_manager;
128  }
129 private:
147 };
148 
149 } /* namespace drizzled */
150