~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/named_savepoint.h

  • Committer: Olaf van der Spek
  • Date: 2011-02-12 18:24:24 UTC
  • mto: (2167.1.2 build) (2172.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 2168.
  • Revision ID: olafvdspek@gmail.com-20110212182424-kgnm9osi7qo97at2
casts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
29
29
namespace drizzled
30
30
{
31
31
 
 
32
namespace message
 
33
{
 
34
class Transaction;
 
35
}
 
36
 
32
37
/**
33
38
 * This is a class which stores information about
34
39
 * a named savepoint in a transaction
41
46
   */
42
47
  NamedSavepoint(const char *in_name, size_t in_name_length) :
43
48
    name(in_name, in_name_length),
44
 
    resource_contexts()
45
 
  {}
46
 
  ~NamedSavepoint()
47
 
  {}
 
49
    resource_contexts(),
 
50
    transaction_message(NULL)
 
51
  {}
 
52
 
 
53
  ~NamedSavepoint();
 
54
 
 
55
  NamedSavepoint(const NamedSavepoint &other);
48
56
 
49
57
  void setResourceContexts(TransactionContext::ResourceContexts &new_contexts)
50
58
  {
66
74
  {
67
75
    return name;
68
76
  }
69
 
  NamedSavepoint(const NamedSavepoint &other)
70
 
  {
71
 
    name.assign(other.getName());
72
 
    const TransactionContext::ResourceContexts &other_resource_contexts= other.getResourceContexts();
73
 
    resource_contexts.assign(other_resource_contexts.begin(),
74
 
                             other_resource_contexts.end());
 
77
  message::Transaction *getTransactionMessage() const
 
78
  {
 
79
    return transaction_message;
 
80
  }
 
81
  void setTransactionMessage(message::Transaction *in_transaction_message)
 
82
  {
 
83
    transaction_message= in_transaction_message;
75
84
  }
76
85
  NamedSavepoint &operator=(const NamedSavepoint &other)
77
86
  {
87
96
private:
88
97
  std::string name;
89
98
  TransactionContext::ResourceContexts resource_contexts;
 
99
  message::Transaction *transaction_message;
90
100
  NamedSavepoint();
91
101
};
92
102