brainstorming ...
This commit is contained in:
20
library/include/mobilisis/tariff_comp_state.h
Normal file
20
library/include/mobilisis/tariff_comp_state.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef TARIFF_COMP_STATE_H_INCLUDED
|
||||
#define TARIFF_COMP_STATE_H_INCLUDED
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
struct TariffCompState {
|
||||
QDateTime const m_start;
|
||||
int m_nettoParkingTimeTotal = 0;
|
||||
int m_bruttoParkingTimeTotal = 0;
|
||||
int m_priceTotal = 0;
|
||||
|
||||
explicit TariffCompState(QDateTime start)
|
||||
: m_start(std::move(start))
|
||||
, m_nettoParkingTimeTotal(0)
|
||||
, m_bruttoParkingTimeTotal(0)
|
||||
, m_priceTotal(0) {
|
||||
}
|
||||
};
|
||||
|
||||
#endif // TARIFF_COMP_STATE_H_INCLUDED
|
29
library/include/mobilisis/tariff_comp_step.h
Normal file
29
library/include/mobilisis/tariff_comp_step.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef TARIFF_COMP_STEP_H_INCLUDED
|
||||
#define TARIFF_COMP_STEP_H_INCLUDED
|
||||
|
||||
#include <QDateTime>
|
||||
#include "tariff_comp_state.h"
|
||||
|
||||
class TariffCompStep {
|
||||
int m_duration;
|
||||
QDateTime const m_start;
|
||||
QDateTime const m_end;
|
||||
uint64_t const m_handle;
|
||||
TariffCompState m_compState;
|
||||
|
||||
uint64_t hash();
|
||||
|
||||
public:
|
||||
explicit TariffCompStep(int duration, QDateTime start, QDateTime end, TariffCompState &compState)
|
||||
: m_duration(duration)
|
||||
, m_start(std::move(start))
|
||||
, m_end(std::move(end))
|
||||
, m_handle(hash())
|
||||
, m_compState(compState) {
|
||||
}
|
||||
|
||||
uint64_t handle() { return m_handle; }
|
||||
uint64_t handle() const { return m_handle; }
|
||||
};
|
||||
|
||||
#endif // TARIFF_COMP_STEP_H_INCLUDED
|
Reference in New Issue
Block a user