mourne_rcpp_fw/app/weather/weather_initializer.cpp
2021-12-18 11:23:59 +01:00

37 lines
748 B
C++

#include "weather_initializer.h"
void WeatherInitializer::allocate_controller() {
ERR_FAIL_COND(_controller);
_controller = new WeatherController();
}
void WeatherInitializer::free_controller() {
if (_controller) {
delete _controller;
_controller = nullptr;
}
}
void WeatherInitializer::allocate_model() {
ERR_FAIL_COND(_model);
_model = new WeatherModel();
}
void WeatherInitializer::free_model() {
if (_model) {
delete _model;
_model = nullptr;
}
}
void WeatherInitializer::allocate_all() {
allocate_model();
allocate_controller();
}
void WeatherInitializer::free_all() {
free_controller();
free_model();
}
WeatherController *WeatherInitializer::_controller = nullptr;
WeatherModel *WeatherInitializer::_model = nullptr;