]> git.sesse.net Git - casparcg/blob - protocol/util/AsyncEventServer.h
Fixed copy-paste error
[casparcg] / protocol / util / AsyncEventServer.h
1 /*
2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
3 *
4 *  This file is part of CasparCG.
5 *
6 *    CasparCG is free software: you can redistribute it and/or modify
7 *    it under the terms of the GNU General Public License as published by
8 *    the Free Software Foundation, either version 3 of the License, or
9 *    (at your option) any later version.
10 *
11 *    CasparCG is distributed in the hope that it will be useful,
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *    GNU General Public License for more details.
15
16 *    You should have received a copy of the GNU General Public License
17 *    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20  
21 // AsyncEventServer.h: interface for the AsyncServer class.
22 //////////////////////////////////////////////////////////////////////
23 #pragma once
24
25 #include "protocol_strategy.h"
26
27 #include <common/memory.h>
28
29 #include <boost/asio.hpp>
30 #include <boost/noncopyable.hpp>
31
32 namespace caspar { namespace IO {
33
34         typedef std::function<std::pair<std::wstring, std::shared_ptr<void>> (const std::string& ipv4_address)>
35                 lifecycle_factory_t;
36
37 class AsyncEventServer : boost::noncopyable
38 {
39 public:
40         explicit AsyncEventServer(
41                         std::shared_ptr<boost::asio::io_service> service, const protocol_strategy_factory<char>::ptr& protocol, unsigned short port);
42         ~AsyncEventServer();
43
44         void add_client_lifecycle_object_factory(const lifecycle_factory_t& lifecycle_factory);
45
46         struct implementation;
47 private:
48         spl::shared_ptr<implementation> impl_;
49 };
50
51 }}      
52