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
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (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 GNU
14
Lesser General Public License for more details.
15
16
You should have received a copy of the GNU Lesser General Public
17
License along with Classified Ads; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#ifndef CLASSIFIED_DATAMODEL_BASE_H
22
#define CLASSIFIED_DATAMODEL_BASE_H
23
#include <QSqlDatabase>
24
#include <QObject>
25
#include "../mcontroller.h"
// because enum from there is needed
26
27
class
QSqlDatabase ;
28
class
QMutex ;
29
class
Hash
;
30
class
ContentEncryptionModel
;
31
39
class
ModelBase
:
public
QObject {
40
Q_OBJECT
41
42
public
:
53
ModelBase
(QString aDataTableName,
54
unsigned
aMaxRowsToKeep ) ;
55
~ModelBase
() ;
68
bool
setTimeLastReference
(
const
Hash
& aObjectFingerPrint,
69
quint32 aTimeWhenLastReferenced) ;
73
unsigned
getMaxRowsToKeep
() ;
77
void
setMaxRowsToKeep
(
unsigned
aRows) ;
83
void
truncateDataTableToMaxRows
(
void
) ;
85
void
updateDbTableRowCount
() ;
86
signals:
87
void
error
(
MController::CAErrorSituation
aError,
88
const
QString& aExplanation) ;
89
90
private
:
// methods
91
virtual
bool
deleteOldestDataRowInTable
() ;
92
protected
:
97
QString
iDataTableName
;
101
unsigned
iMaxRowsToKeep
;
106
unsigned
iCurrentDbTableRowCount
;
107
} ;
108
#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:38
MController::CAErrorSituation
CAErrorSituation
Definition:
mcontroller.h:52
ModelBase::error
void error(MController::CAErrorSituation aError, const QString &aExplanation)
ModelBase::iCurrentDbTableRowCount
unsigned iCurrentDbTableRowCount
Definition:
datamodelbase.h:106
ModelBase::updateDbTableRowCount
void updateDbTableRowCount()
ModelBase
datamodel-parts common part. this is inherited and contains common funcs
Definition:
datamodelbase.h:39
ModelBase::deleteOldestDataRowInTable
virtual bool deleteOldestDataRowInTable()
ModelBase::iMaxRowsToKeep
unsigned iMaxRowsToKeep
Definition:
datamodelbase.h:101
ModelBase::~ModelBase
~ModelBase()
ModelBase::iDataTableName
QString iDataTableName
Definition:
datamodelbase.h:97
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:37
Generated by
1.8.11