X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fserver.h;h=56a1fdab9f20d133f9436c0c028015a8e13a4339;hb=2499c41097f8410cb3016e095a85d68979485a7b;hp=398401a555dd1eff784ad1d2289677e5258660f2;hpb=237a0052c60af768f4d62b00321932918b7ba4d9;p=dcpomatic.git diff --git a/src/lib/server.h b/src/lib/server.h index 398401a55..56a1fdab9 100644 --- a/src/lib/server.h +++ b/src/lib/server.h @@ -17,6 +17,9 @@ */ +#ifndef DCPOMATIC_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. @@ -41,6 +44,11 @@ namespace cxml { 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. */ @@ -50,6 +58,8 @@ public: {} ServerDescription (boost::shared_ptr); + + /* Default copy constructor is fine */ /** @return server's host name or IP address in string form */ std::string host_name () const { @@ -71,7 +81,7 @@ public: void as_xml (xmlpp::Node *) const; - static ServerDescription * create_from_metadata (std::string v); + static boost::optional create_from_metadata (std::string); private: /** server's host name */ @@ -80,7 +90,7 @@ private: int _threads; }; -class Server +class Server : public boost::noncopyable { public: Server (boost::shared_ptr log); @@ -97,3 +107,5 @@ private: boost::condition _worker_condition; boost::shared_ptr _log; }; + +#endif