Move ServerDescription into its own header.
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Aug 2015 15:10:04 +0000 (16:10 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 26 Aug 2015 17:00:28 +0000 (18:00 +0100)
12 files changed:
src/lib/config.cc
src/lib/dcp_video.cc
src/lib/encoder.cc
src/lib/server.cc
src/lib/server.h
src/lib/server_description.h [new file with mode: 0644]
src/lib/server_finder.cc
src/tools/dcpomatic_server.cc
src/tools/server_test.cc
src/wx/servers_list_dialog.cc
src/wx/servers_list_dialog.h
test/client_server_test.cc

index 211637ede2069360704db2a882df2c2eddd43d08..6a3734dcc7091171290d070a8ffba0c8e0823c54 100644 (file)
@@ -22,6 +22,7 @@
 #include "filter.h"
 #include "ratio.h"
 #include "types.h"
 #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"
 #include "dcp_content_type.h"
 #include "cinema_sound_processor.h"
 #include "colour_conversion.h"
index e02bcffca614ee10167975d268c1544c6ccc6c0a..848a5393ce5c9a28195416298dbcad2ea6ef5418 100644 (file)
@@ -31,7 +31,7 @@
 #include "dcp_video.h"
 #include "config.h"
 #include "exceptions.h"
 #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"
 #include "dcpomatic_socket.h"
 #include "image.h"
 #include "log.h"
index 195b10f443bf65f66508dd885bb74a17747de4c8..b35f49a1b9460372d8cd1b458b40ad41edae8f1c 100644 (file)
@@ -34,6 +34,7 @@
 #include "player.h"
 #include "player_video.h"
 #include "data.h"
 #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>
 #include "compose.hpp"
 #include <libcxml/cxml.h>
 #include <boost/foreach.hpp>
index 2fc9404669724c41ada2cd80391d121e57609b12..e7e2a3c5715c7e17b684d5a9dd696b93c8123f6e 100644 (file)
@@ -33,6 +33,7 @@
 #include "safe_stringstream.h"
 #include "raw_convert.h"
 #include "compose.hpp"
 #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>
 #include <libcxml/cxml.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/scoped_array.hpp>
index 51dc8774e166372f6327d3753552bfac2f44601b..314102c1c2b7f5c78ba7cc29c814d46214ab89bc 100644 (file)
 #define DCPOMATIC_SERVER_H
 
 /** @file src/server.h
 #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 "exceptions.h"
-#include <libxml++/libxml++.h>
 #include <boost/thread.hpp>
 #include <boost/asio.hpp>
 #include <boost/thread/condition.hpp>
 #include <boost/thread.hpp>
 #include <boost/asio.hpp>
 #include <boost/thread/condition.hpp>
-#include <boost/optional.hpp>
 #include <string>
 
 class Socket;
 #include <string>
 
 class Socket;
+class Log;
 
 namespace cxml {
        class Node;
 }
 
 
 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:
 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 (file)
index 0000000..b0a1a53
--- /dev/null
@@ -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;
+};
index 3eec6597b55df1d92125b1785ad2998a104adb33..1727016e63919ed9d9b2f2748a14304cab1b6ea1 100644 (file)
@@ -22,6 +22,7 @@
 #include "util.h"
 #include "config.h"
 #include "cross.h"
 #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>
 #include "dcpomatic_socket.h"
 #include "raw_convert.h"
 #include <libcxml/cxml.h>
index e10fd313814cdad562fcb84077e0f6c73934eaca..7ec081cfaf718b6813b859f19839d093609e9309 100644 (file)
 
 */
 
 
 */
 
-#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 "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;
 
 using std::cout;
 using std::string;
index 19b513357af2c216c65a465ebc025d7f03241224..201761ed5e927a81a2db5276438f1c5a736a1868 100644 (file)
 
 */
 
 
 */
 
-#include <iostream>
-#include <iomanip>
-#include <exception>
-#include <getopt.h>
 #include "lib/ratio.h"
 #include "lib/film.h"
 #include "lib/filter.h"
 #include "lib/ratio.h"
 #include "lib/film.h"
 #include "lib/filter.h"
 #include "lib/player.h"
 #include "lib/player_video.h"
 #include "lib/data.h"
 #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;
 
 using std::cout;
 using std::cerr;
index b678da073d498f0e55ebc006fa89dfda85116b28..0c46b1ecf6731688e4947963b27d0c1bbbf9eeb7 100644 (file)
@@ -20,6 +20,7 @@
 #include "servers_list_dialog.h"
 #include "wx_util.h"
 #include "lib/server_finder.h"
 #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>
 
 #include <boost/lexical_cast.hpp>
 #include <boost/foreach.hpp>
 
index 60fcdb236bece157ebd11dcf47e29c23db6ec25f..6adc906552bc487089a547041cba15d35999c0f2 100644 (file)
 
 */
 
 
 */
 
+#include "lib/server.h"
 #include <wx/wx.h>
 #include <wx/listctrl.h>
 #include <wx/wx.h>
 #include <wx/listctrl.h>
-#include "lib/server.h"
+#include <boost/signals2.hpp>
 
 class ServersListDialog : public wxDialog
 {
 
 class ServersListDialog : public wxDialog
 {
index db198e79c3ebd9d26ab310a74dbf8e8bbb4c01ac..89a8e82cc2a6c3463069ef2ec594003fbef521e2 100644 (file)
@@ -25,8 +25,6 @@
  *  encoded data to check that they are the same.
  */
 
  *  encoded data to check that they are the same.
  */
 
-#include <boost/test/unit_test.hpp>
-#include <boost/thread.hpp>
 #include "lib/server.h"
 #include "lib/image.h"
 #include "lib/cross.h"
 #include "lib/server.h"
 #include "lib/image.h"
 #include "lib/cross.h"
 #include "lib/player_video.h"
 #include "lib/raw_image_proxy.h"
 #include "lib/data.h"
 #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 <boost/test/unit_test.hpp>
+#include <boost/thread.hpp>
 
 using std::list;
 using boost::shared_ptr;
 
 using std::list;
 using boost::shared_ptr;