brainstorming ...

This commit is contained in:
2024-10-21 14:31:08 +02:00
parent 5cfca87f3e
commit 41a09d882d
3 changed files with 66 additions and 0 deletions

View 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

View 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