From 7aa7f3af805f2cc80c04901f648f6dcb21e082ec Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Mon, 7 Jan 2013 12:20:41 -0600 Subject: [PATCH] Updates iostream transport to new component style --- websocketpp/transport/iostream/connection.hpp | 3 +++ websocketpp/transport/iostream/endpoint.hpp | 20 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/websocketpp/transport/iostream/connection.hpp b/websocketpp/transport/iostream/connection.hpp index 41f2bc24d3..0a3f10c807 100644 --- a/websocketpp/transport/iostream/connection.hpp +++ b/websocketpp/transport/iostream/connection.hpp @@ -44,9 +44,12 @@ namespace iostream { template class connection { public: + /// Type of this connection transport component typedef connection type; + /// Type of a shared pointer to this connection transport component typedef lib::shared_ptr ptr; + // TODO: clean up the rest of these types class handler_interface {}; typedef lib::shared_ptr handler_ptr; diff --git a/websocketpp/transport/iostream/endpoint.hpp b/websocketpp/transport/iostream/endpoint.hpp index ca9804d4bf..f3cbb77c5b 100644 --- a/websocketpp/transport/iostream/endpoint.hpp +++ b/websocketpp/transport/iostream/endpoint.hpp @@ -28,6 +28,8 @@ #ifndef WEBSOCKETPP_TRANSPORT_IOSTREAM_HPP #define WEBSOCKETPP_TRANSPORT_IOSTREAM_HPP +#include + #include #include @@ -39,9 +41,18 @@ namespace iostream { template class endpoint { public: - typedef iostream::connection con_policy; - typedef typename con_policy::ptr trans_connection_ptr; + /// Type of this endpoint transport component + typedef endpoint type; + /// Type of a pointer to this endpoint transport component + typedef lib::shared_ptr ptr; + /// Type of this endpoint transport component's associated connection + /// transport component. + typedef iostream::connection transport_con_type; + /// Type of a shared pointer to this endpoint transport component's + /// associated connection transport component + typedef typename transport_con_type::ptr transport_con_ptr; + // generate and manage our own io_service explicit endpoint() { @@ -52,9 +63,8 @@ public: output_stream = o; } protected: - template - void init(connection_ptr con) { - con->register_ostream(output_stream); + void init(transport_con_ptr tcon) { + tcon->register_ostream(output_stream); } private: std::ostream* output_stream;