Q4Wine  2.0
Q4Wine is a Qt GUI for Wine.
dbobject.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2008-2016 by Alexey S. Malakhov <brezerk@gmail.com> *
3  * *
4  * This program is free software: you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation, either version 3 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
16  * *
17  ***************************************************************************/
18 
19 #pragma once
20 
21 #include <stdint.h>
22 #include <string>
23 
24 #include "src/lib/defines.hpp"
25 #include "src/lib/db.hpp"
26 
27 namespace q4wine {
28 namespace lib {
29 
40 class DBObject {
41  public:
51  explicit DBObject(std::string tableName, intptr_t id = 0);
53  virtual ~DBObject();
54  virtual bool save(void) = 0;
55 
56  void setId(intptr_t id);
57 
58  intptr_t getId(void) const;
59 
60  protected:
62  std::string tableName_;
63  intptr_t id_;
64 };
65 
66 } // namespace lib
67 } // namespace q4wine
Describes an abstract interface of object to q4wine db.
Definition: dbobject.hpp:40
virtual bool save(void)=0
std::string tableName_
Definition: dbobject.hpp:62
DBObject(std::string tableName, intptr_t id=0)
Definition: dbobject.cpp:25
Definition: db.cpp:23
virtual ~DBObject()
Definition: dbobject.cpp:34
DBEngine * db_
Definition: dbobject.hpp:61
intptr_t getId(void) const
Definition: dbobject.cpp:41
q4wine&#39;s SQLite3 engine warper. This class provides basic common SQL workflow, like making SQL querie...
Definition: db.hpp:59
void setId(intptr_t id)
Definition: dbobject.cpp:37
intptr_t id_
Definition: dbobject.hpp:63