~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-10-24 21:23:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2449.
  • Revision ID: olafvdspek@gmail.com-20111024212354-j32gbc2sbsw0985q
Use str_ref

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 * @file Simple named savepoint class.
22
22
 */
23
23
 
24
 
#ifndef DRIZZLED_NAMED_SAVEPOINT_H
25
 
#define DRIZZLED_NAMED_SAVEPOINT_H
26
 
 
27
 
#include "drizzled/transaction_context.h" /* for TransactionContext::ResourceContexts */
28
 
 
29
 
namespace drizzled
30
 
{
31
 
 
32
 
namespace message
33
 
{
34
 
class Transaction;
35
 
}
 
24
#pragma once
 
25
 
 
26
#include <drizzled/transaction_context.h>
 
27
#include <string>
 
28
 
 
29
namespace drizzled {
36
30
 
37
31
/**
38
32
 * This is a class which stores information about
56
50
 
57
51
  void setResourceContexts(TransactionContext::ResourceContexts &new_contexts)
58
52
  {
59
 
    resource_contexts.assign(new_contexts.begin(), new_contexts.end());
 
53
    resource_contexts= new_contexts;
60
54
  }
61
55
  const TransactionContext::ResourceContexts &getResourceContexts() const
62
56
  {
70
64
  {
71
65
    return name;
72
66
  }
73
 
  const std::string &getName()
74
 
  {
75
 
    return name;
76
 
  }
77
67
  message::Transaction *getTransactionMessage() const
78
68
  {
79
69
    return transaction_message;
87
77
    if (this == &other)
88
78
      return *this;
89
79
 
90
 
    name.assign(other.getName());
91
 
    const TransactionContext::ResourceContexts &other_resource_contexts= other.getResourceContexts();
92
 
    resource_contexts.assign(other_resource_contexts.begin(),
93
 
                             other_resource_contexts.end());
 
80
    name= other.getName();
 
81
    resource_contexts= other.getResourceContexts();
94
82
    return *this;
95
83
  }
96
84
private:
97
85
  std::string name;
98
86
  TransactionContext::ResourceContexts resource_contexts;
99
87
  message::Transaction *transaction_message;
100
 
  NamedSavepoint();
101
88
};
102
89
 
103
90
} /* namespace drizzled */
104
91
 
105
 
#endif /* DRIZZLED_NAMED_SAVEPOINT_H */