All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DBTypes.h
Go to the documentation of this file.
1 /*
2  * DBTypes.h
3  *
4  * This file is part of the HausmiSEP project
5  *
6  * Copyright (C) 2012, 2013 Marco Alvarado (malvcr@gmail.com)
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef DBTYPES_H_
23 #define DBTYPES_H_
24 
25 #include <vector>
26 #include <string>
27 
28 using namespace std;
29 
30 namespace HSEPData {
31 
35  enum DBType {
36  DBT_Null = 0,
37  DBT_Number = 1,
38  DBT_String = 2,
39  DBT_Float = 3,
41  };
42 
43  typedef list<DBType> DBTypeList;
44  typedef pair<DBType,string> DBParameter;
45  typedef vector<DBParameter> DBParameters;
46 
50  #define SETPARAM(destination,type,value) \
51  destination.push_back(make_pair(type,value))
52 
56  #define STRPARAM(destination,value) \
57  destination.push_back(make_pair(DBT_String,value))
58 
62  #define INTPARAM(destination,value) \
63  destination.push_back(make_pair(DBT_Number,to_string(value)))
64 
65 } // HSEPData namespace
66 
67 #endif /* DBTYPES_H_ */