forked from matth-x/MicroOcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.h
More file actions
99 lines (72 loc) · 3.04 KB
/
Copy pathModel.h
File metadata and controls
99 lines (72 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// matth-x/ArduinoOcpp
// Copyright Matthias Akstaller 2019 - 2023
// MIT License
#ifndef AO_MODEL_H
#define AO_MODEL_H
#include <memory>
#include <ArduinoOcpp/Core/Time.h>
#include <ArduinoOcpp/Model/ChargeControl/Connector.h>
namespace ArduinoOcpp {
class TransactionStore;
class SmartChargingService;
class ChargeControlCommon;
class MeteringService;
class FirmwareService;
class DiagnosticsService;
class HeartbeatService;
class AuthorizationService;
class ReservationService;
class BootService;
class ResetService;
class Model {
private:
std::vector<Connector> connectors;
std::unique_ptr<TransactionStore> transactionStore;
std::unique_ptr<SmartChargingService> smartChargingService;
std::unique_ptr<ChargeControlCommon> chargeControlCommon;
std::unique_ptr<MeteringService> meteringService;
std::unique_ptr<FirmwareService> firmwareService;
std::unique_ptr<DiagnosticsService> diagnosticsService;
std::unique_ptr<HeartbeatService> heartbeatService;
std::unique_ptr<AuthorizationService> authorizationService;
std::unique_ptr<ReservationService> reservationService;
std::unique_ptr<BootService> bootService;
std::unique_ptr<ResetService> resetService;
Clock clock;
bool runTasks = false;
const uint16_t bootNr = 0; //each boot of this lib has a unique number
public:
Model(uint16_t bootNr = 0);
Model(const Model& rhs) = delete;
~Model();
void loop();
void activateTasks() {runTasks = true;}
void setTransactionStore(std::unique_ptr<TransactionStore> transactionStore);
TransactionStore *getTransactionStore();
void setSmartChargingService(std::unique_ptr<SmartChargingService> scs);
SmartChargingService* getSmartChargingService() const;
void setChargeControlCommon(std::unique_ptr<ChargeControlCommon> ccs);
ChargeControlCommon *getChargeControlCommon();
void setConnectors(std::vector<Connector>&& connectors);
unsigned int getNumConnectors() const;
Connector *getConnector(unsigned int connectorId);
void setMeteringSerivce(std::unique_ptr<MeteringService> meteringService);
MeteringService* getMeteringService() const;
void setFirmwareService(std::unique_ptr<FirmwareService> firmwareService);
FirmwareService *getFirmwareService() const;
void setDiagnosticsService(std::unique_ptr<DiagnosticsService> diagnosticsService);
DiagnosticsService *getDiagnosticsService() const;
void setHeartbeatService(std::unique_ptr<HeartbeatService> heartbeatService);
void setAuthorizationService(std::unique_ptr<AuthorizationService> authorizationService);
AuthorizationService *getAuthorizationService();
void setReservationService(std::unique_ptr<ReservationService> reservationService);
ReservationService *getReservationService();
void setBootService(std::unique_ptr<BootService> bs);
BootService *getBootService() const;
void setResetService(std::unique_ptr<ResetService> rs);
ResetService *getResetService() const;
Clock &getClock();
uint16_t getBootNr();
};
} //end namespace ArduinoOcpp
#endif