#include "../websocketpp/src/sockets/tls.hpp" #include "../websocketpp/src/websocketpp.hpp" #include "WSDoor.h" #include "Application.h" #include "Log.h" #include "NetworkOPs.h" template class WSServerHandler; // // Storage for connection specific info // - Subscriptions // class WSConnection : public InfoSub { public: typedef websocketpp::WSDOOR_SERVER::handler::connection_ptr connection_ptr; typedef websocketpp::WSDOOR_SERVER::handler::message_ptr message_ptr; protected: typedef void (WSConnection::*doFuncPtr)(Json::Value& jvResult, Json::Value &jvRequest); WSServerHandler* mHandler; connection_ptr mConnection; NetworkOPs& mNetwork; public: // WSConnection() // : mHandler((WSServerHandler*)(NULL)), // mConnection(connection_ptr()) { ; } WSConnection(WSServerHandler* wshpHandler, connection_ptr cpConnection) : mHandler(wshpHandler), mConnection(cpConnection), mNetwork(theApp->getOPs()) { ; } virtual ~WSConnection(); // Implement overridden functions from base class: void send(const Json::Value& jvObj); // Utilities Json::Value invokeCommand(Json::Value& jvRequest); }; // vim:ts=4