X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cti;h=23997a832e88116d89788e6ceb51a65e232c6f32;hb=99822a43b5a79b68563b8ae09e1f36791ede66b1;hp=39b32734aa07196df15eee2ac2306b701a58ed0e;hpb=d2459b6c8249291588fd3d0d125ed3d38e003b55;p=senf.git diff --git a/Socket/SocketHandle.cti b/Socket/SocketHandle.cti index 39b3273..23997a8 100644 --- a/Socket/SocketHandle.cti +++ b/Socket/SocketHandle.cti @@ -88,7 +88,7 @@ prefix_ senf::SocketBody const & senf::SocketHandle::body() } template -prefix_ senf::SocketProtocol const & senf::SocketHandle::protocol() +prefix_ senf::SocketProtocol & senf::SocketHandle::protocol() const { return body().protocol(); @@ -133,11 +133,11 @@ prefix_ Target senf::static_socket_cast(Source handle) template prefix_ Target senf::dynamic_socket_cast(Source handle) { - BOOST_STATIC_ASSERT(( - boost::is_convertible::value && - boost::is_convertible::value && - ( boost::is_convertible::value || - boost::is_convertible::value ) )); +// BOOST_STATIC_ASSERT(( +// boost::is_convertible::value && +// boost::is_convertible::value && +// ( boost::is_convertible::value || +// boost::is_convertible::value ) )); try { return Target::cast_dynamic(handle); } @@ -147,11 +147,11 @@ prefix_ Target senf::dynamic_socket_cast(Source handle) template prefix_ bool senf::check_socket_cast(Source handle) { - BOOST_STATIC_ASSERT(( - boost::is_convertible::value && - boost::is_convertible::value && - ( boost::is_convertible::value || - boost::is_convertible::value ) )); +// BOOST_STATIC_ASSERT(( +// boost::is_convertible::value && +// boost::is_convertible::value && +// ( boost::is_convertible::value || +// boost::is_convertible::value ) )); // we don't have a non-throwing variant of cast_dynamic // for two reasons: // a) since the handle is passed back by value, we cannot return @@ -187,6 +187,17 @@ prefix_ std::string senf::SocketHandle::dumpState(unsigned lod) return detail::dumpState(map); } +template +template +prefix_ Facet & senf::SocketHandle::facet() + +{ + try { + return dynamic_cast(protocol()); + } + SENF_WRAP_EXC(std::bad_cast) +} + /////////////////////////////////////////////////////////////////////////// // senf::ProtocolSocketBody