CommunicationPolicy.cti
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 CommunicationPolicy inline template implementation
16  */
17 
18 //#include "CommunicationPolicy.ih"
19 
20 // Custom includes
21 
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
25 #ifndef DOXYGEN
26 template <class SPolicy>
27 prefix_ void senf::ConnectedCommunicationPolicy::
28 listen(ServerSocketHandle<SPolicy> const & handle, unsigned backlog,
29  typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type *)
30 {
31  do_listen(handle, backlog);
32 }
33 #else
34 template <class SPolicy>
35 prefix_ void senf::ConnectedCommunicationPolicy::
36 listen(ServerSocketHandle<SPolicy> const & handle, unsigned backlog)
37 {}
38 #endif
39 
40 #ifndef DOXYGEN
41 template <class SPolicy>
42 prefix_ int senf::ConnectedCommunicationPolicy::
43 accept(ServerSocketHandle<SPolicy> const & handle,
44  typename ServerSocketHandle<SPolicy>::Address & address,
45  typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type *)
46 {
47  return do_accept(handle,address.sockaddr_p(),address.socklen());
48 }
49 #else
50 template <class SPolicy>
51 prefix_ int senf::ConnectedCommunicationPolicy::
52 accept(ServerSocketHandle<SPolicy> const & handle,
53  typename ServerSocketHandle<SPolicy>::Address & address)
54 {}
55 #endif
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: