libpqxx  4.0.1
isolation.hxx
1 /*-------------------------------------------------------------------------
2  *
3  * FILE
4  * pqxx/isolation.hxx
5  *
6  * DESCRIPTION
7  * definitions of transaction isolation levels
8  * Policies and traits describing SQL transaction isolation levels
9  * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/isolation instead.
10  *
11  * Copyright (c) 2003-2013, Jeroen T. Vermeulen <jtv@xs4all.nl>
12  *
13  * See COPYING for copyright license. If you did not receive a file called
14  * COPYING with this source code, please notify the distributor of this mistake,
15  * or contact the author.
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef PQXX_H_ISOLATION
20 #define PQXX_H_ISOLATION
21 
22 #include "pqxx/compiler-public.hxx"
23 #include "pqxx/compiler-internal-pre.hxx"
24 
25 #include "pqxx/util"
26 
27 namespace pqxx
28 {
29 
31 
61 {
62  // read_uncommitted,
66 };
67 
69 template<isolation_level LEVEL> struct isolation_traits
70 {
71  static isolation_level level() throw () { return LEVEL; }
72  static const char *name() throw ();
73 };
74 
75 
76 template<> inline const char *isolation_traits<read_committed>::name() throw ()
77  { return "READ COMMITTED"; }
78 template<> inline const char *isolation_traits<repeatable_read>::name() throw ()
79  { return "REPEATABLE READ"; }
80 template<> inline const char *isolation_traits<serializable>::name() throw ()
81  { return "SERIALIZABLE"; }
82 
83 }
84 
85 
86 #include "pqxx/compiler-internal-post.hxx"
87 
88 #endif
89