finished input factory
This commit is contained in:
@@ -63,23 +63,28 @@ private:
|
|||||||
{
|
{
|
||||||
std::map<char, Event> events;
|
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;
|
return events;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Event GetEvent(json json_event)
|
|
||||||
{
|
|
||||||
Event event;
|
|
||||||
|
|
||||||
return event;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ConfigureLogger()
|
static void ConfigureLogger()
|
||||||
{
|
{
|
||||||
el::Loggers::getLogger(INPUT_LOGGER);
|
el::Loggers::getLogger(INPUT_LOGGER);
|
||||||
|
|||||||
Reference in New Issue
Block a user