diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-08-26 16:10:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-08-26 18:00:28 +0100 |
| commit | dbf43f9113d88245f27493fd5d6950ba142b7f1f (patch) | |
| tree | a8f884bc08421fd507ca249ea9610cadb09b7336 /src | |
| parent | edbdc717041a76b01b77a4495031478082f5882e (diff) | |
Move ServerDescription into its own header.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.cc | 1 | ||||
| -rw-r--r-- | src/lib/dcp_video.cc | 2 | ||||
| -rw-r--r-- | src/lib/encoder.cc | 1 | ||||
| -rw-r--r-- | src/lib/server.cc | 1 | ||||
| -rw-r--r-- | src/lib/server.h | 55 | ||||
| -rw-r--r-- | src/lib/server_description.h | 64 | ||||
| -rw-r--r-- | src/lib/server_finder.cc | 1 | ||||
| -rw-r--r-- | src/tools/dcpomatic_server.cc | 7 | ||||
| -rw-r--r-- | src/tools/server_test.cc | 9 | ||||
| -rw-r--r-- | src/wx/servers_list_dialog.cc | 1 | ||||
| -rw-r--r-- | src/wx/servers_list_dialog.h | 3 |
11 files changed, 86 insertions, 59 deletions
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 <libcxml/cxml.h> #include <boost/foreach.hpp> 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 <libcxml/cxml.h> #include <boost/algorithm/string.hpp> #include <boost/scoped_array.hpp> 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 <libxml++/libxml++.h> #include <boost/thread.hpp> #include <boost/asio.hpp> #include <boost/thread/condition.hpp> -#include <boost/optional.hpp> #include <string> 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 <cth@carlh.net> + + 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 <libcxml/cxml.h> 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 <boost/thread.hpp> -#include <wx/taskbar.h> -#include <wx/icon.h> #include "wx/wx_util.h" #include "lib/util.h" #include "lib/server.h" #include "lib/config.h" +#include "lib/log.h" +#include <wx/taskbar.h> +#include <wx/icon.h> +#include <boost/thread.hpp> 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 <iostream> -#include <iomanip> -#include <exception> -#include <getopt.h> #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 <getopt.h> +#include <iostream> +#include <iomanip> +#include <exception> 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 <boost/lexical_cast.hpp> #include <boost/foreach.hpp> 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 <wx/wx.h> #include <wx/listctrl.h> -#include "lib/server.h" +#include <boost/signals2.hpp> class ServersListDialog : public wxDialog { |
