openPilotLog
aentry.h
1
/*
2
*openPilot Log - A FOSS Pilot Logbook Application
3
*Copyright (C) 2020 Felix Turowsky
4
*
5
*This program is free software: you can redistribute it and/or modify
6
*it under the terms of the GNU General Public License as published by
7
*the Free Software Foundation, either version 3 of the License, or
8
*(at your option) any later version.
9
*
10
*This program is distributed in the hope that it will be useful,
11
*but WITHOUT ANY WARRANTY; without even the implied warranty of
12
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
*GNU General Public License for more details.
14
*
15
*You should have received a copy of the GNU General Public License
16
*along with this program. If not, see <https://www.gnu.org/licenses/>.
17
*/
18
#ifndef ENTRY_H
19
#define ENTRY_H
20
21
#include <QString>
22
#include <QStringList>
23
#include <QMap>
24
#include <QPair>
25
#include <QVariant>
26
27
#include "decl.h"
28
29
namespace
experimental
{
30
31
// [G]: Define what data is public and what not. For objects such as
32
// DataPosition which are consumable its no biggy. Are entries the same?
33
// If so we could avoid getters and setters
34
// [F]: In the way we are using the entries atm, we do access and edit the
35
// TableData quite frequently. Maybe the data could be public, but the
36
// position private? Except for creating a new entry, the position should
37
// never really be changed.
42
class
AEntry
{
43
protected
:
44
DataPosition
position;
45
public
:
46
TableData tableData;
47
public
:
48
AEntry
() =
delete
;
// Demand specificity from default constructor
49
AEntry
(
const
AEntry
&) =
default
;
50
AEntry
& operator=(
const
AEntry
&) =
default
;
51
AEntry
(
DataPosition
position_);
52
AEntry
(TableData table_data);
53
AEntry
(
DataPosition
position_, TableData table_data);
54
55
void
setData(TableData table_data);
56
void
setPosition(
DataPosition
position_);
57
58
const
DataPosition
& getPosition();
59
const
TableData& getData();
60
61
};
62
63
}
64
65
#endif // ENTRY_H
experimental
Temporary namespace for experimental features. Will be removed in later versions.
Definition:
aaircraftentry.cpp:20
experimental::DataPosition
Definition:
decl.h:45
experimental::AEntry
The Entry class encapsulates table metadata(table name, row id) and data for new and existing entries...
Definition:
aentry.h:42
src
experimental
aentry.h
Generated by
1.8.20