SOIL C++
C++ Unified Device Interface
Configuration.cpp
Go to the documentation of this file.
1#include "Configuration.h"
2#include <nlohmann/json.hpp>
3#include <fstream>
4
6
8{
9 clients.clear();
10}
11
13{
14 std::ifstream infile(filename);
15 json j;
16 infile >> j;
17
18 for (json::iterator it = j["clients"].begin(); it != j["clients"].end(); it++)
19 {
20 clients[(*it)["address"]] = (*it)["port"];
21 }
22}
23
25{
26 clients.clear();
27}
nlohmann::json json
std::map< std::string, int > clients
List of clients.
Definition: Configuration.h:28
~Configuration()
Destructor.
Configuration()
Constructor.