finished input factory

This commit is contained in:
Neeflix
2018-05-31 21:51:54 +02:00
parent 660f196b71
commit b033429ab0

View File

@@ -63,23 +63,28 @@ private:
{
std::map<char, Event> events;
for(auto& key : matrix_config)
for(auto& json_event : matrix_config)
{
auto event = this->GetEvent(key);
try
{
std::string name = json_event.at("name");
char address = json_event.at("address");
int priority = json_event.at("priority");
events.emplace(key, event);
Event event(address, priority, name);
events.emplace(address, event);
}
catch(json::exception& e)
{
CLOG(ERROR, INPUT_LOGGER) << "Matrix config corrupted, check all events!";
exit(EXIT_FAILURE);
}
}
return events;
}
static Event GetEvent(json json_event)
{
Event event;
return event;
}
static void ConfigureLogger()
{
el::Loggers::getLogger(INPUT_LOGGER);