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
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
15 \brief InterfaceAPIBase inline template implementation */
17 //#include "InterfaceAPIBase.ih"
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::emu::InterfaceAPIBase< Wired,Bidirectional,void >
27 template <class Output, class Input>
29 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
30 senf::emu::interface::Bidirectional>::
31 InterfaceAPIBase(Output & output, Input & input)
32 : WiredReceiver(output), WiredTransmitter(input)
35 //-/////////////////////////////////////////////////////////////////////////////////////////////////
36 // senf::emu::InterfaceAPIBase< Wired,Bidirectional,Hardware >
38 template <class Output, class Input>
40 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
41 senf::emu::interface::Bidirectional,
42 senf::emu::interface::Hardware>::
43 InterfaceAPIBase(Output & output, Input & input)
44 : BidirectionalWiredInterface(output, input)
47 //-/////////////////////////////////////////////////////////////////////////////////////////////////
48 // senf::emu::InterfaceAPIBase< Wired,ReceiveOnly,Hardware >
50 template <class Output>
52 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
53 senf::emu::interface::ReceiveOnly,
54 senf::emu::interface::Hardware>::
55 InterfaceAPIBase(Output & output)
56 : WiredReceiver(output)
59 //-/////////////////////////////////////////////////////////////////////////////////////////////////
60 // senf::emu::InterfaceAPIBase< Wired,TransmitOnly,Hardware >
62 template <class Input>
64 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
65 senf::emu::interface::TransmitOnly,
66 senf::emu::interface::Hardware>::
67 InterfaceAPIBase(Input & input)
68 : WiredTransmitter(input)
71 //-/////////////////////////////////////////////////////////////////////////////////////////////////
72 // senf::emu::InterfaceAPIBase< Wireless,Bidirectional,void >
74 template <class Output, class Input>
76 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
77 senf::emu::interface::Bidirectional>::
78 InterfaceAPIBase(Output & output, Input & input)
79 : WirelessReceiver(output), WirelessTransmitter(input)
82 //-/////////////////////////////////////////////////////////////////////////////////////////////////
83 // senf::emu::InterfaceAPIBase< Wireless,Bidirectional,Hardware >
85 template <class Output, class Input>
87 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
88 senf::emu::interface::Bidirectional,
89 senf::emu::interface::Hardware>::
90 InterfaceAPIBase(Output & output, Input & input)
91 : BidirectionalWirelessInterface(output, input)
94 //-/////////////////////////////////////////////////////////////////////////////////////////////////
95 // senf::emu::InterfaceAPIBase< Wireless,ReceiveOnly,Hardware >
97 template <class Output>
99 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
100 senf::emu::interface::ReceiveOnly,
101 senf::emu::interface::Hardware>::
102 InterfaceAPIBase(Output & output)
103 : WirelessReceiver(output)
106 //-/////////////////////////////////////////////////////////////////////////////////////////////////
107 // senf::emu::InterfaceAPIBase< Wireless,TransmitOnly,Hardware >
109 template <class Input>
111 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
112 senf::emu::interface::TransmitOnly,
113 senf::emu::interface::Hardware>::
114 InterfaceAPIBase(Input & input)
115 : WirelessTransmitter(input)
118 //-/////////////////////////////////////////////////////////////////////////////////////////////////
119 // senf::emu::InterfaceAPIBase< Wired,Bidirectional,Emulated >
121 template <class Base>
122 template <class Output, class Input>
124 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
125 senf::emu::interface::Bidirectional,
126 senf::emu::interface::Emulated,
128 InterfaceAPIBase(Output & output, Input & input)
129 : Base(output, input)
132 template <class Base>
134 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
135 senf::emu::interface::Bidirectional,
136 senf::emu::interface::Emulated,
140 enableEmulatedInterface();
143 template <class Base>
145 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
146 senf::emu::interface::Bidirectional,
147 senf::emu::interface::Emulated,
151 disableEmulatedInterface();
154 template <class Base>
156 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
157 senf::emu::interface::Bidirectional,
158 senf::emu::interface::Emulated,
163 return emulatedInterfaceEnabled();
166 template <class Base>
168 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
169 senf::emu::interface::Bidirectional,
170 senf::emu::interface::Emulated,
172 v_initEmulationInterface()
174 initEmulatedReceiver();
175 initEmulatedTransmitter();
178 template <class Base>
180 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
181 senf::emu::interface::Bidirectional,
182 senf::emu::interface::Emulated,
184 v_deinitEmulationInterface()
186 deinitEmulatedTransmitter();
187 deinitEmulatedReceiver();
190 template <class Base>
192 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
193 senf::emu::interface::Bidirectional,
194 senf::emu::interface::Emulated,
199 return promiscEmulatedReceiver();
202 template <class Base>
204 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
205 senf::emu::interface::Bidirectional,
206 senf::emu::interface::Emulated,
210 promiscEmulatedReceiver(v);
213 template <class Base>
215 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
216 senf::emu::interface::Bidirectional,
217 senf::emu::interface::Emulated,
222 return annotationModeEmulatedReceiver();
225 template <class Base>
227 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
228 senf::emu::interface::Bidirectional,
229 senf::emu::interface::Emulated,
231 v_annotationMode(bool a)
233 annotationModeEmulatedReceiver(a);
237 template <class Base>
239 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
240 senf::emu::interface::Bidirectional,
241 senf::emu::interface::Emulated,
243 v_mcAdd(senf::MACAddress const & address)
245 mcAddEmulatedReceiver(address);
248 template <class Base>
250 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
251 senf::emu::interface::Bidirectional,
252 senf::emu::interface::Emulated,
254 v_mcDrop(senf::MACAddress const & address)
256 mcDropEmulatedReceiver(address);
259 template <class Base>
261 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
262 senf::emu::interface::Bidirectional,
263 senf::emu::interface::Emulated,
268 return mtuEmulatedTransmitter();
271 template <class Base>
273 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
274 senf::emu::interface::Bidirectional,
275 senf::emu::interface::Emulated,
279 mtuEmulatedTransmitter(v);
282 template <class Base>
284 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
285 senf::emu::interface::Bidirectional,
286 senf::emu::interface::Emulated,
291 EmulatedWiredInterface::init();
292 EmulatedWiredReceiver::init();
293 EmulatedWiredTransmitter::init();
297 //-/////////////////////////////////////////////////////////////////////////////////////////////////
298 // senf::emu::InterfaceAPIBase< Wired,ReceiveOnly,Emulated >
300 template <class Output>
302 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
303 senf::emu::interface::ReceiveOnly,
304 senf::emu::interface::Emulated>::
305 InterfaceAPIBase(Output & output)
306 : WiredReceiver(output)
309 //-/////////////////////////////////////////////////////////////////////////////////////////////////
310 // senf::emu::InterfaceAPIBase< Wired,TransmitOnly,Emulated >
312 template <class Input>
314 senf::emu::InterfaceAPIBase<senf::emu::interface::Wired,
315 senf::emu::interface::TransmitOnly,
316 senf::emu::interface::Emulated>::
317 InterfaceAPIBase(Input & input)
318 : WiredTransmitter(input)
321 //-/////////////////////////////////////////////////////////////////////////////////////////////////
322 // senf::emu::InterfaceAPIBase< Wireless,Bidirectional,Emulated >
324 template <class Base>
325 template <class Output, class Input>
327 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
328 senf::emu::interface::Bidirectional,
329 senf::emu::interface::Emulated,
331 InterfaceAPIBase(Output & output, Input & input)
332 : Base(output, input)
335 template <class Base>
337 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
338 senf::emu::interface::Bidirectional,
339 senf::emu::interface::Emulated,
343 enableEmulatedInterface();
346 template <class Base>
348 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
349 senf::emu::interface::Bidirectional,
350 senf::emu::interface::Emulated,
354 disableEmulatedInterface();
357 template <class Base>
359 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
360 senf::emu::interface::Bidirectional,
361 senf::emu::interface::Emulated,
366 return emulatedInterfaceEnabled();
369 template <class Base>
371 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
372 senf::emu::interface::Bidirectional,
373 senf::emu::interface::Emulated,
375 v_initEmulationInterface()
377 initEmulatedReceiver();
378 initEmulatedTransmitter();
381 template <class Base>
383 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
384 senf::emu::interface::Bidirectional,
385 senf::emu::interface::Emulated,
387 v_deinitEmulationInterface()
389 deinitEmulatedTransmitter();
390 deinitEmulatedReceiver();
393 template <class Base>
395 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
396 senf::emu::interface::Bidirectional,
397 senf::emu::interface::Emulated,
402 return promiscEmulatedReceiver();
405 template <class Base>
407 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
408 senf::emu::interface::Bidirectional,
409 senf::emu::interface::Emulated,
413 promiscEmulatedReceiver(v);
416 template <class Base>
418 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
419 senf::emu::interface::Bidirectional,
420 senf::emu::interface::Emulated,
425 return annotationModeEmulatedReceiver();
428 template <class Base>
430 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
431 senf::emu::interface::Bidirectional,
432 senf::emu::interface::Emulated,
434 v_annotationMode(bool a)
436 annotationModeEmulatedReceiver(a);
439 template <class Base>
441 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
442 senf::emu::interface::Bidirectional,
443 senf::emu::interface::Emulated,
445 v_mcAdd(senf::MACAddress const & address)
447 mcAddEmulatedReceiver(address);
450 template <class Base>
452 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
453 senf::emu::interface::Bidirectional,
454 senf::emu::interface::Emulated,
456 v_mcDrop(senf::MACAddress const & address)
458 mcDropEmulatedReceiver(address);
461 template <class Base>
463 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
464 senf::emu::interface::Bidirectional,
465 senf::emu::interface::Emulated,
470 return mtuEmulatedTransmitter();
473 template <class Base>
475 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
476 senf::emu::interface::Bidirectional,
477 senf::emu::interface::Emulated,
481 mtuEmulatedTransmitter(v);
484 template <class Base>
486 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
487 senf::emu::interface::Bidirectional,
488 senf::emu::interface::Emulated,
493 return emulatedFrequency();
496 template <class Base>
498 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
499 senf::emu::interface::Bidirectional,
500 senf::emu::interface::Emulated,
505 return emulatedBandwidth();
508 template <class Base>
510 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
511 senf::emu::interface::Bidirectional,
512 senf::emu::interface::Emulated,
514 v_frequency(unsigned frequency, unsigned bandwidth)
516 emulatedFrequency(frequency, bandwidth);
519 template <class Base>
521 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
522 senf::emu::interface::Bidirectional,
523 senf::emu::interface::Emulated,
525 v_coverageRange(unsigned distance)
527 emulatedCoverageRange(distance);
530 template <class Base>
532 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
533 senf::emu::interface::Bidirectional,
534 senf::emu::interface::Emulated,
539 EmulatedWirelessInterface::init();
540 EmulatedWirelessReceiver::init();
541 EmulatedWirelessTransmitter::init();
545 //-/////////////////////////////////////////////////////////////////////////////////////////////////
546 // senf::emu::InterfaceAPIBase< Wireless,ReceiveOnly,Emulated >
548 template <class Base>
549 template <class Output>
551 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
552 senf::emu::interface::ReceiveOnly,
553 senf::emu::interface::Emulated,
555 InterfaceAPIBase(Output & output)
556 : WirelessReceiver(output)
559 template <class Base>
561 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
562 senf::emu::interface::ReceiveOnly,
563 senf::emu::interface::Emulated,
567 enableEmulatedInterface();
570 template <class Base>
572 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
573 senf::emu::interface::ReceiveOnly,
574 senf::emu::interface::Emulated,
578 disableEmulatedInterface();
581 template <class Base>
583 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
584 senf::emu::interface::ReceiveOnly,
585 senf::emu::interface::Emulated,
590 return emulatedInterfaceEnabled();
593 template <class Base>
595 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
596 senf::emu::interface::ReceiveOnly,
597 senf::emu::interface::Emulated,
599 v_initEmulationInterface()
601 initEmulatedReceiver();
604 template <class Base>
606 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
607 senf::emu::interface::ReceiveOnly,
608 senf::emu::interface::Emulated,
610 v_deinitEmulationInterface()
612 deinitEmulatedReceiver();
615 template <class Base>
617 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
618 senf::emu::interface::ReceiveOnly,
619 senf::emu::interface::Emulated,
624 return promiscEmulatedReceiver();
627 template <class Base>
629 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
630 senf::emu::interface::ReceiveOnly,
631 senf::emu::interface::Emulated,
635 promiscEmulatedReceiver(v);
638 template <class Base>
640 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
641 senf::emu::interface::ReceiveOnly,
642 senf::emu::interface::Emulated,
647 return annotationModeEmulatedReceiver();
650 template <class Base>
652 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
653 senf::emu::interface::ReceiveOnly,
654 senf::emu::interface::Emulated,
656 v_annotationMode(bool a)
658 annotationModeEmulatedReceiver(a);
661 template <class Base>
663 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
664 senf::emu::interface::ReceiveOnly,
665 senf::emu::interface::Emulated,
667 v_mcAdd(senf::MACAddress const & address)
669 mcAddEmulatedReceiver(address);
672 template <class Base>
674 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
675 senf::emu::interface::ReceiveOnly,
676 senf::emu::interface::Emulated,
678 v_mcDrop(senf::MACAddress const & address)
680 mcDropEmulatedReceiver(address);
683 template <class Base>
685 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
686 senf::emu::interface::ReceiveOnly,
687 senf::emu::interface::Emulated,
692 return emulatedFrequency();
695 template <class Base>
697 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
698 senf::emu::interface::ReceiveOnly,
699 senf::emu::interface::Emulated,
704 return emulatedBandwidth();
707 template <class Base>
709 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
710 senf::emu::interface::ReceiveOnly,
711 senf::emu::interface::Emulated,
713 v_frequency(unsigned frequency, unsigned bandwidth)
715 emulatedFrequency(frequency, bandwidth);
718 template <class Base>
720 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
721 senf::emu::interface::ReceiveOnly,
722 senf::emu::interface::Emulated,
724 v_coverageRange(unsigned distance)
726 emulatedCoverageRange(distance);
729 template <class Base>
731 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
732 senf::emu::interface::ReceiveOnly,
733 senf::emu::interface::Emulated,
738 WirelessReceiver::init();
739 EmulatedWirelessInterface::init();
740 EmulatedWirelessReceiver::init();
744 //-/////////////////////////////////////////////////////////////////////////////////////////////////
745 // senf::emu::InterfaceAPIBase< Wireless,TransmitOnly,Emulated >
747 template <class Base>
748 template <class Input>
750 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
751 senf::emu::interface::TransmitOnly,
752 senf::emu::interface::Emulated,
754 InterfaceAPIBase(Input & input)
755 : WirelessTransmitter(input)
758 template <class Base>
760 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
761 senf::emu::interface::TransmitOnly,
762 senf::emu::interface::Emulated,
766 enableEmulatedInterface();
769 template <class Base>
771 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
772 senf::emu::interface::TransmitOnly,
773 senf::emu::interface::Emulated,
777 disableEmulatedInterface();
780 template <class Base>
782 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
783 senf::emu::interface::TransmitOnly,
784 senf::emu::interface::Emulated,
789 return emulatedInterfaceEnabled();
792 template <class Base>
794 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
795 senf::emu::interface::TransmitOnly,
796 senf::emu::interface::Emulated,
798 v_initEmulationInterface()
800 initEmulatedTransmitter();
803 template <class Base>
805 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
806 senf::emu::interface::TransmitOnly,
807 senf::emu::interface::Emulated,
809 v_deinitEmulationInterface()
811 deinitEmulatedTransmitter();
814 template <class Base>
816 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
817 senf::emu::interface::TransmitOnly,
818 senf::emu::interface::Emulated,
823 return mtuEmulatedTransmitter();
826 template <class Base>
828 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
829 senf::emu::interface::TransmitOnly,
830 senf::emu::interface::Emulated,
834 mtuEmulatedTransmitter(v);
837 template <class Base>
839 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
840 senf::emu::interface::TransmitOnly,
841 senf::emu::interface::Emulated,
846 return emulatedFrequency();
849 template <class Base>
851 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
852 senf::emu::interface::TransmitOnly,
853 senf::emu::interface::Emulated,
858 return emulatedBandwidth();
861 template <class Base>
863 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
864 senf::emu::interface::TransmitOnly,
865 senf::emu::interface::Emulated,
867 v_frequency(unsigned frequency, unsigned bandwidth)
869 emulatedFrequency(frequency, bandwidth);
872 template <class Base>
874 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
875 senf::emu::interface::TransmitOnly,
876 senf::emu::interface::Emulated,
878 v_coverageRange(unsigned distance)
880 emulatedCoverageRange(distance);
883 template <class Base>
885 senf::emu::InterfaceAPIBase<senf::emu::interface::Wireless,
886 senf::emu::interface::TransmitOnly,
887 senf::emu::interface::Emulated,
892 WirelessTransmitter::init();
893 EmulatedWirelessInterface::init();
894 EmulatedWirelessTransmitter::init();
897 //-/////////////////////////////////////////////////////////////////////////////////////////////////
904 // comment-column: 40
905 // c-file-style: "senf"
906 // indent-tabs-mode: nil
907 // ispell-local-dictionary: "american"
908 // compile-command: "scons -u test"