WIP. RemoteServer, DbUpdate settings implemented

This commit is contained in:
emeric
2014-08-21 15:45:32 +02:00
parent e8b2412cd6
commit e7707d9faa
7 changed files with 62 additions and 15 deletions
+2 -2
View File
@@ -4,9 +4,9 @@
namespace Service {
DatabaseUpdateService::DatabaseUpdateService(const boost::filesystem::path& p)
DatabaseUpdateService::DatabaseUpdateService(const Config& config)
: _metadataParser(),
_databaseUpdater( p, _metadataParser)
_databaseUpdater( config.dbPath, _metadataParser)
{
}
+6 -1
View File
@@ -17,7 +17,12 @@ class DatabaseUpdateService : public Service
typedef std::shared_ptr<DatabaseUpdateService> pointer;
DatabaseUpdateService(const boost::filesystem::path& p);
struct Config {
bool enable;
boost::filesystem::path dbPath;
};
DatabaseUpdateService(const Config& config);
// Service interface
void start(void);
+2 -2
View File
@@ -3,8 +3,8 @@
namespace Service {
RemoteServerService::RemoteServerService(const Remote::Server::Server::endpoint_type& endpoint, boost::filesystem::path dbPath)
: _server(endpoint, dbPath)
RemoteServerService::RemoteServerService(const Config& config)
: _server(boost::asio::ip::tcp::endpoint(config.address, config.port), config.dbPath)
{
}
+9 -1
View File
@@ -2,6 +2,7 @@
#define REMOTE_SERVER_SERVICE_HPP
#include <boost/filesystem.hpp>
#include <boost/asio/ip/address.hpp>
#include "Service.hpp"
@@ -13,7 +14,14 @@ class RemoteServerService : public Service
{
public:
RemoteServerService(const Remote::Server::Server::endpoint_type& endpoint, boost::filesystem::path dbPath);
struct Config {
bool enable;
boost::asio::ip::address address;
unsigned short port;
boost::filesystem::path dbPath;
};
RemoteServerService(const Config& config);
void start(void);
void stop(void);