MOBILISIS-Calculator/library/include/mobilisis/tariff_timebase.h

45 lines
1.2 KiB
C

#ifndef TARIFF_TIME_BASE_H_INCLUDED
#define TARIFF_TIME_BASE_H_INCLUDED
#include <QString>
#include <QDebug>
#include <QDebugStateSaver>
struct ATBTimeBase {
enum class TimeBaseType {ABSOLUTE=0, RELATIVE=1};
ATBTimeBase() = default;
int tbase_id;
TimeBaseType tbase_type;
QString tbase_label;
friend QDebug operator<<(QDebug debug, ATBTimeBase const &timeBase) {
QDebugStateSaver saver(debug);
debug.nospace() << "TIMEBASE" << "\n";
switch(timeBase.tbase_type) {
case ATBTimeBase::TimeBaseType::ABSOLUTE:
debug.nospace()
<< " tbase_id: " << timeBase.tbase_id << "\n"
<< " tbase_type: " << "TimeBaseType::ABSOLUTE" << "\n"
<< "tbase_label: " << timeBase.tbase_label << "\n";
break;
case ATBTimeBase::TimeBaseType::RELATIVE:
debug.nospace()
<< " tbase_type: " << "TimeBaseType::RELATIVE" << "\n"
<< "tbase_label: " << timeBase.tbase_label << "\n";
break;
default:
debug.nospace()
<< " tbase_type: " << "TimeBaseType::???" << "\n";
break;
}
return debug;
}
};
#endif // TARIFF_TIME_BASE_H_INCLUDED