comparison OrthancServer/SQLiteDatabaseWrapper.h @ 3019:8336204d95dc db-changes

refactoring computation of disk size for recycling
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Dec 2018 18:07:40 +0100
parents 517fc4767ae0
children d207f6ac1f86
comparison
equal deleted inserted replaced
3018:e3b5c07146a3 3019:8336204d95dc
34 #pragma once 34 #pragma once
35 35
36 #include "IDatabaseWrapper.h" 36 #include "IDatabaseWrapper.h"
37 37
38 #include "../Core/SQLite/Connection.h" 38 #include "../Core/SQLite/Connection.h"
39 #include "../Core/SQLite/Transaction.h"
40 39
41 namespace Orthanc 40 namespace Orthanc
42 { 41 {
43 namespace Internals 42 namespace Internals
44 { 43 {
51 * exclusion MUST be implemented at a higher level. 50 * exclusion MUST be implemented at a higher level.
52 **/ 51 **/
53 class SQLiteDatabaseWrapper : public IDatabaseWrapper 52 class SQLiteDatabaseWrapper : public IDatabaseWrapper
54 { 53 {
55 private: 54 private:
55 class Transaction;
56
56 IDatabaseListener* listener_; 57 IDatabaseListener* listener_;
57 SQLite::Connection db_; 58 SQLite::Connection db_;
58 Internals::SignalRemainingAncestor* signalRemainingAncestor_; 59 Internals::SignalRemainingAncestor* signalRemainingAncestor_;
59 unsigned int version_; 60 unsigned int version_;
60 61
98 int64_t since, 99 int64_t since,
99 uint32_t maxResults); 100 uint32_t maxResults);
100 101
101 virtual void GetLastChange(std::list<ServerIndexChange>& target /*out*/); 102 virtual void GetLastChange(std::list<ServerIndexChange>& target /*out*/);
102 103
103 virtual SQLite::ITransaction* StartTransaction() 104 virtual IDatabaseWrapper::ITransaction* StartTransaction();
104 {
105 return new SQLite::Transaction(db_);
106 }
107 105
108 virtual void FlushToDisk() 106 virtual void FlushToDisk()
109 { 107 {
110 db_.FlushToDisk(); 108 db_.FlushToDisk();
111 } 109 }