SocketHandle.ct
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
14 /** \file
15  \brief SocketHandle non-inline template implementation
16  */
17 
18 #include "SocketHandle.ih"
19 
20 // Custom includes
21 #include <boost/lexical_cast.hpp>
22 #include <senf/Utils/TypeInfo.hh>
23 
24 #define prefix_
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 //-/////////////////////////////////////////////////////////////////////////////////////////////////
28 // senf::detail::StreamableString
29 
30 template <class T>
31 prefix_ senf::detail::StreamableString &
32 senf::detail::StreamableString::operator<<(T const & other)
33 {
34  if (!empty())
35  (*this) += ", ";
36  (*this) += boost::lexical_cast<std::string>(other);
37  return *this;
38 }
39 
40 //-/////////////////////////////////////////////////////////////////////////////////////////////////
41 // senf::ProtocolSocketBody<SProtocol>
42 
43 template <class SProtocol>
44 prefix_ senf::SocketProtocol const & senf::ProtocolSocketBody<SProtocol>::v_protocol()
45  const
46 {
47  return *this;
48 }
49 
50 template <class SProtocol>
51 prefix_ std::string senf::ProtocolSocketBody<SProtocol>::v_protocolName()
52  const
53 {
54  return senf::prettyName(typeid(SProtocol));
55 }
56 
57 //-/////////////////////////////////////////////////////////////////////////////////////////////////
58 #undef prefix_
59 
60 
61 // Local Variables:
62 // mode: c++
63 // fill-column: 100
64 // c-file-style: "senf"
65 // indent-tabs-mode: nil
66 // ispell-local-dictionary: "american"
67 // compile-command: "scons -u test"
68 // comment-column: 40
69 // End: