WIP. RemoteServer, DbUpdate settings implemented
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user