WirelessNLController.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 WirelessNLController non-inline template implementation */
16 
17 // Custom includes
18 #include <boost/range.hpp>
19 #include <boost/range/concepts.hpp>
20 
21 #define prefix_
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::emu::WirelessNLController::JoinParameters
26 
27 template <typename ForwardReadableRange>
28 prefix_ prefix_ senf::emu::WirelessNLController::JoinParameters::ptr senf::emu::WirelessNLController::JoinParameters::informationElements(ForwardReadableRange const & ies)
29 {
30  std::copy( boost::begin(ies), boost::end(ies), back_inserter(ies_));
31  return shared_from_this();
32 }
33 
34 //-/////////////////////////////////////////////////////////////////////////////////////////////////
35 // senf::emu::WirelessNLController::NetlinkEvent<EventType>
36 
37 template <typename EventType>
38 prefix_ senf::emu::WirelessNLController::NetlinkEvent<EventType>::NetlinkEvent(WirelessNLController & wnlc)
39  : wnlc_(wnlc)
40 {}
41 
42 template <typename EventType>
43 prefix_ void senf::emu::WirelessNLController::NetlinkEvent<EventType>::enable()
44 {
45  wnlc_.join_multicastGroup(EventType::MCGroup);
46 }
47 
48 template <typename EventType>
49 prefix_ void senf::emu::WirelessNLController::NetlinkEvent<EventType>::disable()
50 {
51  wnlc_.leave_multicastGroup(EventType::MCGroup);
52 }
53 
54 //-/////////////////////////////////////////////////////////////////////////////////////////////////
55 // senf::emu::WirelessNLController
56 
57 template <typename ForwardReadableRange>
58 prefix_ void senf::emu::WirelessNLController::trigger_scan(ForwardReadableRange const & frequencies)
59 {
60  std::set<frequency_type> freqs;
61  std::copy(boost::begin(frequencies), boost::end(frequencies), std::back_inserter(freqs));
62  do_trigger_scan(freqs);
63 }
64 
65 //-/////////////////////////////////////////////////////////////////////////////////////////////////
66 #undef prefix_