# openPilotLog: src/experimental/UserInput.h Source File

UserInput.h
#ifndef __USERINPUT_H__
#define __USERINPUT_H__
#include <QPair>
#include <QString>
#include <QBitArray>
#include <QMap>
#include <QStringList>
#include <algorithm>
namespace experimental {
using EntryData = QMap<QString, QString>;
class UserInput {
private:
const EntryData data;
public:
const enum class MetaTag {Pilot, Flight, Aircraft} meta_tag;
public:
UserInput() = delete;
explicit
UserInput(EntryData new_data, MetaTag tag)
: data(new_data), meta_tag(tag) {}
QString only(QString data_type) const { return data.value(data_type); }
const EntryData& all() const { return data; }
};
UserInput newPilotInput(EntryData ed) { return UserInput(ed, UserInput::MetaTag::Pilot); }
UserInput newFlightInput(EntryData ed) { return UserInput(ed, UserInput::MetaTag::Flight); }
UserInput newAircraftInput(EntryData ed) { return UserInput(ed, UserInput::MetaTag::Aircraft); }
}
#endif
Flight
Definition: flight.h:28
experimental
Temporary namespace for experimental features. Will be removed in later versions.
Definition: aaircraftentry.cpp:20
experimental::UserInput
The EntryData struct. Contains ALL possible data. However depending on who is constructing it,...
Definition: UserInput.h:25
Aircraft
The aircraft class.
Definition: aircraft.h:28
Pilot
Definition: pilot.h:24