mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
|
|
#pragma once
|
|
#include "moses/TypeDef.h"
|
|
|
|
#ifdef WITH_THREADS
|
|
#include <boost/thread.hpp>
|
|
#include "moses/ThreadPool.h"
|
|
#endif
|
|
|
|
#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"
|
|
#include "moses/parameters/ServerOptions.h"
|
|
#include <string>
|
|
|
|
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;
|
|
std::string m_pidfile;
|
|
public:
|
|
Server(Moses::Parameter& params);
|
|
~Server();
|
|
int run();
|
|
void delete_session(uint64_t const session_id);
|
|
|
|
Moses::ServerOptions const&
|
|
options() const;
|
|
|
|
Session const&
|
|
get_session(uint64_t session_id);
|
|
|
|
};
|
|
}
|