From: Carl Hetherington Date: Wed, 26 Aug 2015 15:10:04 +0000 (+0100) Subject: Move ServerDescription into its own header. X-Git-Tag: v2.1.47~27 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=dbf43f9113d88245f27493fd5d6950ba142b7f1f Move ServerDescription into its own header. --- diff --git a/src/lib/config.cc b/src/lib/config.cc index 211637ede..6a3734dcc 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -22,6 +22,7 @@ #include "filter.h" #include "ratio.h" #include "types.h" +#include "log.h" #include "dcp_content_type.h" #include "cinema_sound_processor.h" #include "colour_conversion.h" diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index e02bcffca..848a5393c 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -31,7 +31,7 @@ #include "dcp_video.h" #include "config.h" #include "exceptions.h" -#include "server.h" +#include "server_description.h" #include "dcpomatic_socket.h" #include "image.h" #include "log.h" diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 195b10f44..b35f49a1b 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -34,6 +34,7 @@ #include "player.h" #include "player_video.h" #include "data.h" +#include "server_description.h" #include "compose.hpp" #include #include diff --git a/src/lib/server.cc b/src/lib/server.cc index 2fc940466..e7e2a3c57 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -33,6 +33,7 @@ #include "safe_stringstream.h" #include "raw_convert.h" #include "compose.hpp" +#include "log.h" #include #include #include diff --git a/src/lib/server.h b/src/lib/server.h index 51dc8774e..314102c1c 100644 --- a/src/lib/server.h +++ b/src/lib/server.h @@ -21,71 +21,26 @@ #define DCPOMATIC_SERVER_H /** @file src/server.h - * @brief Class to describe a server to which we can send - * encoding work, and a class to implement such a server. + * @brief Server class. */ -#include "log.h" #include "exceptions.h" -#include #include #include #include -#include #include class Socket; +class Log; namespace cxml { class Node; } -/** @class ServerDescription - * @brief Class to describe a server to which we can send encoding work. +/** @class Server + * @brief A class to run a server which can accept requests to perform JPEG2000 + * encoding work. */ -class ServerDescription -{ -public: - ServerDescription () - : _host_name ("") - , _threads (1) - {} - - /** @param h Server host name or IP address in string form. - * @param t Number of threads to use on the server. - */ - ServerDescription (std::string h, int t) - : _host_name (h) - , _threads (t) - {} - - /* Default copy constructor is fine */ - - /** @return server's host name or IP address in string form */ - std::string host_name () const { - return _host_name; - } - - /** @return number of threads to use on the server */ - int threads () const { - return _threads; - } - - void set_host_name (std::string n) { - _host_name = n; - } - - void set_threads (int t) { - _threads = t; - } - -private: - /** server's host name */ - std::string _host_name; - /** number of threads to use on the server */ - int _threads; -}; - class Server : public ExceptionStore, public boost::noncopyable { public: diff --git a/src/lib/server_description.h b/src/lib/server_description.h new file mode 100644 index 000000000..b0a1a538e --- /dev/null +++ b/src/lib/server_description.h @@ -0,0 +1,64 @@ +/* + Copyright (C) 2012 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @class ServerDescription + * @brief Class to describe a server to which we can send encoding work. + */ +class ServerDescription +{ +public: + ServerDescription () + : _host_name ("") + , _threads (1) + {} + + /** @param h Server host name or IP address in string form. + * @param t Number of threads to use on the server. + */ + ServerDescription (std::string h, int t) + : _host_name (h) + , _threads (t) + {} + + /* Default copy constructor is fine */ + + /** @return server's host name or IP address in string form */ + std::string host_name () const { + return _host_name; + } + + /** @return number of threads to use on the server */ + int threads () const { + return _threads; + } + + void set_host_name (std::string n) { + _host_name = n; + } + + void set_threads (int t) { + _threads = t; + } + +private: + /** server's host name */ + std::string _host_name; + /** number of threads to use on the server */ + int _threads; +}; diff --git a/src/lib/server_finder.cc b/src/lib/server_finder.cc index 3eec6597b..1727016e6 100644 --- a/src/lib/server_finder.cc +++ b/src/lib/server_finder.cc @@ -22,6 +22,7 @@ #include "util.h" #include "config.h" #include "cross.h" +#include "server_description.h" #include "dcpomatic_socket.h" #include "raw_convert.h" #include diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc index e10fd3138..7ec081cfa 100644 --- a/src/tools/dcpomatic_server.cc +++ b/src/tools/dcpomatic_server.cc @@ -17,13 +17,14 @@ */ -#include -#include -#include #include "wx/wx_util.h" #include "lib/util.h" #include "lib/server.h" #include "lib/config.h" +#include "lib/log.h" +#include +#include +#include using std::cout; using std::string; diff --git a/src/tools/server_test.cc b/src/tools/server_test.cc index 19b513357..201761ed5 100644 --- a/src/tools/server_test.cc +++ b/src/tools/server_test.cc @@ -17,10 +17,6 @@ */ -#include -#include -#include -#include #include "lib/ratio.h" #include "lib/film.h" #include "lib/filter.h" @@ -34,6 +30,11 @@ #include "lib/player.h" #include "lib/player_video.h" #include "lib/data.h" +#include "lib/server_description.h" +#include +#include +#include +#include using std::cout; using std::cerr; diff --git a/src/wx/servers_list_dialog.cc b/src/wx/servers_list_dialog.cc index b678da073..0c46b1ecf 100644 --- a/src/wx/servers_list_dialog.cc +++ b/src/wx/servers_list_dialog.cc @@ -20,6 +20,7 @@ #include "servers_list_dialog.h" #include "wx_util.h" #include "lib/server_finder.h" +#include "lib/server_description.h" #include #include diff --git a/src/wx/servers_list_dialog.h b/src/wx/servers_list_dialog.h index 60fcdb236..6adc90655 100644 --- a/src/wx/servers_list_dialog.h +++ b/src/wx/servers_list_dialog.h @@ -17,9 +17,10 @@ */ +#include "lib/server.h" #include #include -#include "lib/server.h" +#include class ServersListDialog : public wxDialog { diff --git a/test/client_server_test.cc b/test/client_server_test.cc index db198e79c..89a8e82cc 100644 --- a/test/client_server_test.cc +++ b/test/client_server_test.cc @@ -25,8 +25,6 @@ * encoded data to check that they are the same. */ -#include -#include #include "lib/server.h" #include "lib/image.h" #include "lib/cross.h" @@ -34,6 +32,10 @@ #include "lib/player_video.h" #include "lib/raw_image_proxy.h" #include "lib/data.h" +#include "lib/server_description.h" +#include "lib/log.h" +#include +#include using std::list; using boost::shared_ptr;