summaryrefslogtreecommitdiff
path: root/src/WebSocketSessionMan.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-22 01:10:38 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-22 01:10:38 +0900
commit07d270c87e6f9184aea4ca17eb26e466712e8db2 (patch)
tree2dfbaa2e0d2ad0f38cb73098608f7d67a64320f8 /src/WebSocketSessionMan.cc
parent126a4bde612eb0e6c48cf2f13ebe3eac45cc71a8 (diff)
Require -std=c++11 and use std::shared_ptr instead of SharedHandle
Diffstat (limited to 'src/WebSocketSessionMan.cc')
-rw-r--r--src/WebSocketSessionMan.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/WebSocketSessionMan.cc b/src/WebSocketSessionMan.cc
index 54c96fac..edc961f0 100644
--- a/src/WebSocketSessionMan.cc
+++ b/src/WebSocketSessionMan.cc
@@ -33,6 +33,9 @@
*/
/* copyright --> */
#include "WebSocketSessionMan.h"
+
+#include <cassert>
+
#include "WebSocketSession.h"
#include "RequestGroup.h"
#include "json.h"
@@ -49,14 +52,14 @@ WebSocketSessionMan::WebSocketSessionMan() {}
WebSocketSessionMan::~WebSocketSessionMan() {}
void WebSocketSessionMan::addSession
-(const SharedHandle<WebSocketSession>& wsSession)
+(const std::shared_ptr<WebSocketSession>& wsSession)
{
A2_LOG_DEBUG("WebSocket session added.");
sessions_.insert(wsSession);
}
void WebSocketSessionMan::removeSession
-(const SharedHandle<WebSocketSession>& wsSession)
+(const std::shared_ptr<WebSocketSession>& wsSession)
{
A2_LOG_DEBUG("WebSocket session removed.");
sessions_.erase(wsSession);
@@ -65,12 +68,12 @@ void WebSocketSessionMan::removeSession
void WebSocketSessionMan::addNotification
(const std::string& method, const RequestGroup* group)
{
- SharedHandle<Dict> dict = Dict::g();
+ std::shared_ptr<Dict> dict = Dict::g();
dict->put("jsonrpc", "2.0");
dict->put("method", method);
- SharedHandle<Dict> eventSpec = Dict::g();
+ std::shared_ptr<Dict> eventSpec = Dict::g();
eventSpec->put("gid", GroupId::toHex((group->getGID())));
- SharedHandle<List> params = List::g();
+ std::shared_ptr<List> params = List::g();
params->append(eventSpec);
dict->put("params", params);
std::string msg = json::encode(dict);