Bump version to 0.3.
[profile/ivi/settings-daemon.git] / src / websocket_server.hpp
1 /**
2  * @file websocket_server.hpp
3  *
4  * @brief Settings daemon WebSocket server header.
5  *
6  * @author Ossama Othman @<ossama.othman@@intel.com@>
7  *
8  * @copyright @par
9  * Copyright 2013 Intel Corporation All Rights Reserved.
10  * @par
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation;
14  * version 2.1 of the License.
15  * @par
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  * @par
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  * Boston, MA  02110-1301  USA
25  *
26  * @note This header is internal.
27  */
28
29 #ifndef IVI_SETTINGS_WEBSOCKET_SERVER_HPP
30 #define IVI_SETTINGS_WEBSOCKET_SERVER_HPP
31
32 #include <libwebsockets.h>
33
34
35 namespace ivi
36 {
37   namespace settings
38   {
39     class configurator;
40     class manager;
41
42     /**
43      * @class websocket_server
44      *
45      * @brief IVI Settings web socket server
46      *
47      * This class implements the server that listens for and handles
48      * web socket events.
49      */
50     class websocket_server
51     {
52     public:
53
54       /// Constructor.
55       websocket_server(configurator const & config,
56                        manager & manager);
57
58       /// Destructor.
59       ~websocket_server();
60
61       /// Run the websocket server event loop in its own thread.
62       void run();
63
64     private:
65
66       /**
67        * @name Prevent copying
68        */
69       //@{
70       websocket_server(websocket_server const &) = delete;
71       websocket_server & operator=(websocket_server const &) = delete;
72       //@}
73
74     private:
75
76       /// Our libwebsocket state.
77       libwebsocket_context * context_;
78
79     };
80
81   }
82 }
83
84
85 #endif /* IVI_SETTINGS_WEBSOCKET_SERVER_HPP */
86
87
88 // Local Variables:
89 // mode:c++
90 // c-basic-offset:2
91 // indent-tabs-mode: nil
92 // End: