DVBInterface.hh
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 
17 #ifndef HH_SENF_Ext_NetEmu_DVB_DVBInterface_
18 #define HH_SENF_Ext_NetEmu_DVB_DVBInterface_ 1
19 
20 // Custom includes
22 
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
25 namespace senf {
26 namespace emu {
27 
28  class DVBModulationParameterRegistry;
29 
30 
32  : public ModulationParameter
33  {
34  public:
35  // enums copied from <linux/dvb/frontend.h>
36  enum fec_rate_t {
39  enum modulation_t {
45 
49 
50  private:
51  DVBModulationParameter(std::string const & _label, short _minRssi, unsigned _rate,
53 
54  virtual boost::uint16_t v_modulationId() const;
55  virtual ModulationParameter * v_clone() const;
56  virtual void v_dump(std::ostream & os) const;
57  virtual void v_dumpTableHeader(std::ostream & os) const;
58  virtual void v_dumpTableRow(std::ostream & os) const;
59 
61  };
62 
63 
65  : private boost::noncopyable
66  {
68 
69  ModulationParameter::id_t registerModulation(DVBModulationParameter & p);
70 
71  typedef std::map<ModulationParameter::id_t, DVBModulationParameter> Modulations;
72  Modulations modulations_;
73  typedef std::map<boost::uint16_t, ModulationParameter::id_t> IdTranslateMap;
74  IdTranslateMap idTranslateMap_;
75 
76  public:
78  static DVBModulationParameterRegistry _instance;
79  return _instance;
80  }
81 
82  DVBModulationParameter const & findModulationById(ModulationParameter::id_t id) const;
85 
86  typedef boost::transform_iterator< ::__gnu_cxx::select1st<Modulations::value_type>,
87  Modulations::const_iterator > ModulationParameterId_iterator;
88  typedef boost::iterator_range<ModulationParameterId_iterator> ModulationParameterIds;
89  ModulationParameterIds parameterIds() const;
90  };
91 
92 
94  : public WirelessInterface
95  {
96  public:
97  static const boost::uint8_t linkTypeId = 40; // 802.21b link type for DVB
98 
101 
102  protected:
103  void init();
104 
105  private:
106  virtual boost::uint8_t v_linkTypeId() const;
108  DVBModulationParameter::guard_interval_t gi, unsigned frequency) = 0;
109  };
110 
111 }}
112 
113 //-/////////////////////////////////////////////////////////////////////////////////////////////////
114 //#include "DVBInterface.cci"
115 //#include "DVBInterface.ct"
116 //#include "DVBInterface.cti"
117 #endif
118 
119 
120 // Local Variables:
121 // mode: c++
122 // fill-column: 100
123 // comment-column: 40
124 // c-file-style: "senf"
125 // indent-tabs-mode: nil
126 // ispell-local-dictionary: "american"
127 // compile-command: "scons -u test"
128 // End:
WirelessInterfaceAPI public header.
void init()
boost::iterator_range< ModulationParameterId_iterator > ModulationParameterIds
Definition: DVBInterface.hh:88
static DVBModulationParameterRegistry & instance()
Definition: DVBInterface.hh:77
boost::transform_iterator< ::__gnu_cxx::select1st< Modulations::value_type >, Modulations::const_iterator > ModulationParameterId_iterator
Definition: DVBInterface.hh:87
Wireless modulation parameter.
Interface API base class specialization for wireless interfaces.
__be16 freq