Particle Identification and Tracking
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
common_src
include
sql_handler.h
Go to the documentation of this file.
1
//Copyright 2010 Thomas A Caswell
2
//tcaswell@uchicago.edu
3
//http://jfi.uchicago.edu/~tcaswell
4
//
5
//This program is free software; you can redistribute it and/or modify
6
//it under the terms of the GNU General Public License as published by
7
//the Free Software Foundation; either version 3 of the License, or (at
8
//your option) any later version.
9
//
10
//This program is distributed in the hope that it will be useful, but
11
//WITHOUT ANY WARRANTY; without even the implied warranty of
12
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
//General Public License for more details.
14
//
15
//You should have received a copy of the GNU General Public License
16
//along with this program; if not, see <http://www.gnu.org/licenses>.
17
18
#ifndef SQL_HANDLER
19
#define SQL_HANDLER
20
21
#include<string>
22
23
// forward definition of sqlite3 class do get around include the header for sqlite3 in
24
// a lot of my code.
25
struct
sqlite3;
26
27
28
namespace
utilities
29
{
30
class
Md_store;
31
38
typedef
enum
F_TYPE
{
39
F_NOFUNCTION
= 0,
40
F_IDEN
= 1,
41
F_IDEN_AVG
= 2,
42
F_GOFR
= 3,
43
F_GOFR3D
= 4,
44
F_GOFR_BY_PLANE
= 5,
45
F_LINK3D
= 6,
46
F_MSD
= 7,
47
F_PHI6
= 8,
48
F_TRACK_STATS
= 9,
49
F_TRACKING
= 10,
50
F_VANHOVE
= 11,
51
F_MSD_SWEEP
= 12
52
}
F_TYPE
;
53
54
55
56
std::string
ftype_to_str
(
F_TYPE
f);
57
58
64
class
SQL_handler
65
{
66
public
:
71
SQL_handler
();
75
~SQL_handler
();
76
77
82
void
open_connection
(
const
std::string& db_name);
83
87
void
close_connection
();
88
101
int
start_comp
(
int
dset_key,
102
int
& comp_key,
103
F_TYPE
f_type
104
);
105
109
void
add_mdata
(
const
Md_store
& md_store);
110
118
void
commit
();
125
void
rollback
();
126
127
131
void
make_test_db
(std::string
fname
=
""
);
132
136
void
get_comp_mdata
(
int
comp_key,
Md_store
& md_store,std::string table_name);
137
138
protected
:
139
void
iden_md_fun
(
const
Md_store
& md_store);
140
void
tracking_md_fun
(
const
Md_store
& md_store);
141
void
msd_md_fun
(
const
Md_store
& md_store);
142
void
gofr_md_fun
(
const
Md_store
& md_store);
143
void
vanHove_md_fun
(
const
Md_store
& md_store);
144
void
gofr_by_plane_md_fun
(
const
Md_store
& md_store);
145
void
msd_sweep_md_fun
(
const
Md_store
& md_store);
146
void
phi6_md_fun
(
const
Md_store
& md_store);
147
148
149
private
:
153
sqlite3 *
db_
;
154
158
bool
conn_open_
;
162
bool
trans_open_
;
166
F_TYPE
trans_type_
;
167
171
int
comp_key_
;
172
173
};
174
175
}
176
177
178
#endif
Generated on Tue Sep 10 2013 17:07:21 for Particle Identification and Tracking by
1.8.4