~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/named_savepoint.h

Merge Joe, plus I updated the tests.

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, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
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
 
 
37
32
/**
38
33
 * This is a class which stores information about
39
34
 * a named savepoint in a transaction
46
41
   */
47
42
  NamedSavepoint(const char *in_name, size_t in_name_length) :
48
43
    name(in_name, in_name_length),
49
 
    resource_contexts(),
50
 
    transaction_message(NULL)
51
 
  {}
52
 
 
53
 
  ~NamedSavepoint();
54
 
 
55
 
  NamedSavepoint(const NamedSavepoint &other);
 
44
    resource_contexts()
 
45
  {}
 
46
  ~NamedSavepoint()
 
47
  {}
56
48
 
57
49
  void setResourceContexts(TransactionContext::ResourceContexts &new_contexts)
58
50
  {
74
66
  {
75
67
    return name;
76
68
  }
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;
 
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());
84
75
  }
85
76
  NamedSavepoint &operator=(const NamedSavepoint &other)
86
77
  {
96
87
private:
97
88
  std::string name;
98
89
  TransactionContext::ResourceContexts resource_contexts;
99
 
  message::Transaction *transaction_message;
100
90
  NamedSavepoint();
101
91
};
102
92