Classified ads
Main Page
Classes
Files
File List
File Members
datamodel
datamodelbase.h
Go to the documentation of this file.
1
/* -*-C++-*- -*-coding: utf-8-unix;-*-
2
Classified Ads is Copyright (c) Antti Jarvinen 2013.
3
4
This file is part of Classified Ads.
5
6
Classified Ads is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
Classified Ads is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with Classified Ads. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef CLASSIFIED_DATAMODEL_BASE_H
21
#define CLASSIFIED_DATAMODEL_BASE_H
22
#include <QSqlDatabase>
23
#include <QObject>
24
#include "../mcontroller.h"
// because enum from there is needed
25
26
class
QSqlDatabase ;
27
class
QMutex ;
28
class
Hash
;
29
class
ContentEncryptionModel
;
30
38
class
ModelBase
:
public
QObject {
39
Q_OBJECT
40
41
public
:
52
ModelBase
(QString aDataTableName,
53
unsigned
aMaxRowsToKeep ) ;
54
~ModelBase
() ;
67
bool
setTimeLastReference
(
const
Hash
& aObjectFingerPrint,
68
quint32 aTimeWhenLastReferenced) ;
72
unsigned
getMaxRowsToKeep
() ;
76
void
setMaxRowsToKeep
(
unsigned
aRows) ;
82
void
truncateDataTableToMaxRows
(
void
) ;
84
void
updateDbTableRowCount
() ;
85
signals:
86
void
error
(
MController::CAErrorSituation
aError,
87
const
QString& aExplanation) ;
88
89
private
:
// methods
90
virtual
bool
deleteOldestDataRowInTable
() ;
91
protected
:
96
QString
iDataTableName
;
100
unsigned
iMaxRowsToKeep
;
105
unsigned
iCurrentDbTableRowCount
;
106
} ;
107
#endif
ModelBase::getMaxRowsToKeep
unsigned getMaxRowsToKeep()
ModelBase::setMaxRowsToKeep
void setMaxRowsToKeep(unsigned aRows)
ModelBase::setTimeLastReference
bool setTimeLastReference(const Hash &aObjectFingerPrint, quint32 aTimeWhenLastReferenced)
Hash
Hash is class that carries 160-bit digest.
Definition:
hash.h:37
MController::CAErrorSituation
CAErrorSituation
Definition:
mcontroller.h:48
ModelBase::error
void error(MController::CAErrorSituation aError, const QString &aExplanation)
ModelBase::iCurrentDbTableRowCount
unsigned iCurrentDbTableRowCount
Definition:
datamodelbase.h:105
ModelBase::updateDbTableRowCount
void updateDbTableRowCount()
ModelBase
datamodel-parts common part. this is inherited and contains common funcs
Definition:
datamodelbase.h:38
ModelBase::deleteOldestDataRowInTable
virtual bool deleteOldestDataRowInTable()
ModelBase::iMaxRowsToKeep
unsigned iMaxRowsToKeep
Definition:
datamodelbase.h:100
ModelBase::~ModelBase
~ModelBase()
ModelBase::iDataTableName
QString iDataTableName
Definition:
datamodelbase.h:96
ModelBase::truncateDataTableToMaxRows
void truncateDataTableToMaxRows(void)
ModelBase::ModelBase
ModelBase(QString aDataTableName, unsigned aMaxRowsToKeep)
ContentEncryptionModel
This is content-crypto-operations-specific part of the datamodel.
Definition:
contentencryptionmodel.h:36
Generated on Mon Jan 5 2015 23:02:08 for Classified ads by
1.8.8