libpqxx
nontransaction.hxx
1 
13 #ifndef PQXX_H_NONTRANSACTION
14 #define PQXX_H_NONTRANSACTION
15 
16 #include "pqxx/compiler-public.hxx"
17 #include "pqxx/compiler-internal-pre.hxx"
18 
19 #include "pqxx/connection_base.hxx"
20 #include "pqxx/result.hxx"
21 #include "pqxx/transaction_base.hxx"
22 
23 // Methods tested in eg. test module test01 are marked with "//[t01]".
24 
25 namespace pqxx
26 {
27 
29 
54 class PQXX_LIBEXPORT nontransaction : public transaction_base
55 {
56 public:
58 
63  explicit nontransaction( //[t14]
64  connection_base &C,
65  const std::string &Name=std::string()) :
66  namedclass("nontransaction", Name), transaction_base(C) { Begin(); }
67 
68  virtual ~nontransaction(); //[t14]
69 
70 private:
71  virtual void do_begin() override {} //[t14]
72  virtual result do_exec(const char C[]) override; //[t14]
73  virtual void do_commit() override {} //[t14]
74  virtual void do_abort() override {} //[t14]
75 };
76 
77 } // namespace pqxx
78 
79 #include "pqxx/compiler-internal-post.hxx"
80 
81 #endif
Simple "transaction" class offering no transactional integrity.
Definition: nontransaction.hxx:54
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:22
Result set containing data returned by a query or command.
Definition: result.hxx:67
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:130
nontransaction(connection_base &C, const std::string &Name=std::string())
Constructor.
Definition: nontransaction.hxx:63
connection_base abstract base class; represents a connection to a database.
Definition: connection_base.hxx:138