2015-08-04 03:59:28 +03:00
|
|
|
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
|
|
|
#pragma once
|
2015-08-10 17:40:04 +03:00
|
|
|
#include "moses/TypeDef.h"
|
2015-11-04 21:12:49 +03:00
|
|
|
|
2015-08-10 17:40:04 +03:00
|
|
|
#ifdef WITH_THREADS
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
#include "moses/ThreadPool.h"
|
|
|
|
#endif
|
2015-11-04 21:12:49 +03:00
|
|
|
|
2015-08-04 03:59:28 +03:00
|
|
|
#include <xmlrpc-c/base.hpp>
|
|
|
|
#include <xmlrpc-c/registry.hpp>
|
|
|
|
#include <xmlrpc-c/server_abyss.hpp>
|
|
|
|
#include "Translator.h"
|
|
|
|
#include "Optimizer.h"
|
|
|
|
#include "Updater.h"
|
|
|
|
#include "CloseSession.h"
|
|
|
|
#include "Session.h"
|
2015-08-10 13:04:45 +03:00
|
|
|
#include "moses/parameters/ServerOptions.h"
|
2015-12-07 19:01:12 +03:00
|
|
|
#include <string>
|
2015-08-04 03:59:28 +03:00
|
|
|
|
|
|
|
namespace MosesServer
|
|
|
|
{
|
|
|
|
class Server
|
|
|
|
{
|
|
|
|
Moses::ServerOptions m_server_options;
|
|
|
|
SessionCache m_session_cache;
|
|
|
|
xmlrpc_c::registry m_registry;
|
|
|
|
xmlrpc_c::methodPtr const m_updater;
|
|
|
|
xmlrpc_c::methodPtr const m_optimizer;
|
|
|
|
xmlrpc_c::methodPtr const m_translator;
|
|
|
|
xmlrpc_c::methodPtr const m_close_session;
|
2015-12-07 19:01:12 +03:00
|
|
|
std::string m_pidfile;
|
2015-08-04 03:59:28 +03:00
|
|
|
public:
|
|
|
|
Server(Moses::Parameter& params);
|
2015-12-07 19:01:12 +03:00
|
|
|
~Server();
|
2015-08-04 03:59:28 +03:00
|
|
|
int run();
|
|
|
|
void delete_session(uint64_t const session_id);
|
|
|
|
|
|
|
|
Moses::ServerOptions const&
|
|
|
|
options() const;
|
|
|
|
|
|
|
|
Session const&
|
|
|
|
get_session(uint64_t session_id);
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|