summaryrefslogtreecommitdiff
path: root/src/connectionhandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/connectionhandler.h')
-rw-r--r--src/connectionhandler.h33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/connectionhandler.h b/src/connectionhandler.h
index 402f531..0e28cd3 100644
--- a/src/connectionhandler.h
+++ b/src/connectionhandler.h
@@ -25,8 +25,7 @@
* along with Munia; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __MUNIA_CONNECTIONHANDLER_H__
-#define __MUNIA_CONNECTIONHANDLER_H__
+#pragma once
#include <list>
#include <set>
@@ -36,35 +35,33 @@
#include "task.h"
-typedef struct libwebsocket* clientid_t;
+typedef struct lws* clientid_t;
typedef std::map<clientid_t, bool> AuthList;
typedef std::map<clientid_t, std::set<taskid_t> > ConnectionList;
typedef std::list<std::pair<clientid_t, taskid_t> > ObserverList;
-class ConnectionHandler {
+class ConnectionHandler
+{
public:
- ConnectionHandler();
+ ConnectionHandler();
- void init(clientid_t clientid);
- void close(clientid_t clientid);
+ void init(clientid_t clientid);
+ void close(clientid_t clientid);
- void login(clientid_t clientid, std::string user, std::string password);
- void logout(clientid_t clientid);
- bool authenticated(clientid_t clientid);
+ void login(clientid_t clientid, std::string user, std::string password);
+ void logout(clientid_t clientid);
+ bool authenticated(clientid_t clientid);
- void observe(clientid_t clientid, taskid_t taskid);
- void unobserve(clientid_t clientid, taskid_t taskid);
+ void observe(clientid_t clientid, taskid_t taskid);
+ void unobserve(clientid_t clientid, taskid_t taskid);
-
- ObserverList observerlist(TaskIdList tasklist);
+ ObserverList observerlist(TaskIdList tasklist);
private:
- ConnectionList connlist;
- AuthList authlist;
+ ConnectionList connlist;
+ AuthList authlist;
};
// Global ConnectionHandler
extern ConnectionHandler connection_handler;
-
-#endif/*__MUNIA_CONNECTIONHANDLER_H__*/