Commit 3c03666e authored by Micha Mueller's avatar Micha Mueller
Browse files

Refactor: Move pluginVector_t typedef in own header file. Move restAPISettings...

Refactor: Move pluginVector_t typedef in own header file. Move restAPISettings struct to HttpsServer
parent 19ffc502
......@@ -8,24 +8,15 @@
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include <vector>
#include <set>
#include "Configurator.h"
#include "HttpsServer.h"
#include "PluginDefinitions.h"
#include "Sensor.h"
#include <boost/property_tree/ptree.hpp>
#include <boost/log/trivial.hpp>
typedef struct {
std::string restHost;
std::string restPort;
std::string certificate;
std::string privateKey;
std::string dhFile;
} restAPISettings_t;
typedef struct {
int daemonize;
int brokerPort;
......@@ -37,16 +28,6 @@
restAPISettings_t restAPISettings;
} global_t;
//struct of values required for a dynamic library.
typedef struct {
std::string id;
void* DL;
Configurator* configurator;
create_t* create;
destroy_t* destroy;
} dl_t;
typedef std::vector<dl_t> pluginVector_t;
typedef std::set<std::string> mqttSet_t;
/**
......
......@@ -15,7 +15,15 @@
#include <asio/ssl.hpp>
#include "Logging.h"
#include "Configuration.h"
#include "PluginDefinitions.h"
typedef struct {
std::string restHost;
std::string restPort;
std::string certificate;
std::string privateKey;
std::string dhFile;
} restAPISettings_t;
/*
* Provides REST API services over configurable host and port.
......
/*
* PluginDefinitions.h
*
* Created on: 15.06.2018
* Author: Micha Mueller
*/
#ifndef PLUGINDEFINITIONS_H_
#define PLUGINDEFINITIONS_H_
/*
* Simple header file to pull the pluginVector_t typedef out of Configuration.h
* This way HttpsServer.h only needs to include PluginDefinitions.h and we can avoid
* a dependency circle when including HttpsServer.h from Configuration.h
*/
#include <string>
#include <vector>
#include "Configurator.h"
//struct of values required for a dynamic library.
typedef struct {
std::string id;
void* DL;
Configurator* configurator;
create_t* create;
destroy_t* destroy;
} dl_t;
typedef std::vector<dl_t> pluginVector_t;
#endif /* PLUGINDEFINITIONS_H_ */
......@@ -285,7 +285,8 @@ int main(int argc, char** argv) {
LOG(info) << " Certificate: " << globalSettings.restAPISettings.certificate;
LOG(info) << " Private key file: " << globalSettings.restAPISettings.privateKey;
LOG(info) << " DH params from: " << globalSettings.restAPISettings.dhFile;
//asdf
#else
LOG(info) << " Certificate, private key and DH-param file not printed.";
#endif
//Init all sensors
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment