~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to drizzled/named_savepoint.h

  • Committer: Padraig O'Sullivan
  • Date: 2010-03-15 14:05:26 UTC
  • mfrom: (1237.9.99 staging)
  • Revision ID: osullivan.padraig@gmail.com-20100315140526-opbgwdwn6tfecdkq
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#ifndef DRIZZLED_NAMED_SAVEPOINT_H
25
25
#define DRIZZLED_NAMED_SAVEPOINT_H
26
26
 
27
 
class Ha_trx_info;
 
27
#include "drizzled/transaction_context.h" /* for TransactionContext::ResourceContexts */
28
28
 
29
29
namespace drizzled
30
30
{
40
40
   * Constructor
41
41
   */
42
42
  NamedSavepoint(const char *in_name, size_t in_name_length) :
43
 
    ha_list(NULL),
44
 
    name(in_name, in_name_length)
 
43
    name(in_name, in_name_length),
 
44
    resource_contexts()
45
45
  {}
46
46
  ~NamedSavepoint()
47
47
  {}
48
 
  Ha_trx_info *ha_list;
 
48
 
 
49
  void setResourceContexts(TransactionContext::ResourceContexts &new_contexts)
 
50
  {
 
51
    resource_contexts.assign(new_contexts.begin(), new_contexts.end());
 
52
  }
 
53
  const TransactionContext::ResourceContexts &getResourceContexts() const
 
54
  {
 
55
    return resource_contexts;
 
56
  }
 
57
  TransactionContext::ResourceContexts &getResourceContexts()
 
58
  {
 
59
    return resource_contexts;
 
60
  }
49
61
  const std::string &getName() const
50
62
  {
51
63
    return name;
57
69
  NamedSavepoint(const NamedSavepoint &other)
58
70
  {
59
71
    name.assign(other.getName());
60
 
    ha_list= other.ha_list;
 
72
    const TransactionContext::ResourceContexts &other_resource_contexts= other.getResourceContexts();
 
73
    resource_contexts.assign(other_resource_contexts.begin(),
 
74
                             other_resource_contexts.end());
 
75
  }
 
76
  NamedSavepoint &operator=(const NamedSavepoint &other)
 
77
  {
 
78
    if (this == &other)
 
79
      return *this;
 
80
 
 
81
    name.assign(other.getName());
 
82
    const TransactionContext::ResourceContexts &other_resource_contexts= other.getResourceContexts();
 
83
    resource_contexts.assign(other_resource_contexts.begin(),
 
84
                             other_resource_contexts.end());
 
85
    return *this;
61
86
  }
62
87
private:
63
88
  std::string name;
 
89
  TransactionContext::ResourceContexts resource_contexts;
64
90
  NamedSavepoint();
65
91
};
66
92