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 InterfaceDecorator inline non-template implementation */
17 //#include "InterfaceDecorator.ih"
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::emu::ReceiverDecorator
27 prefix_ senf::emu::ReceiverDecorator::~ReceiverDecorator()
30 //-/////////////////////////////////////////////////////////////////////////////////////////////////
31 // senf::emu::TransmitterDecorator
33 prefix_ senf::emu::TransmitterDecorator::~TransmitterDecorator()
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
37 // senf::emu::InterfaceDecorator
39 prefix_ senf::emu::InterfaceDecorator::~InterfaceDecorator()
42 prefix_ senf::emu::Interface & senf::emu::InterfaceDecorator::interface()
47 prefix_ senf::emu::Interface const & senf::emu::InterfaceDecorator::interface()
53 prefix_ senf::emu::Interface * senf::emu::InterfaceDecorator::operator->()
58 prefix_ senf::emu::Interface const * senf::emu::InterfaceDecorator::operator->()
64 prefix_ senf::emu::ReceiverDecorator & senf::emu::InterfaceDecorator::receiverDecorator()
67 return dynamic_cast<ReceiverDecorator &>(*this);
69 SENF_WRAP_EXC(std::bad_cast)
72 prefix_ senf::emu::ReceiverDecorator const & senf::emu::InterfaceDecorator::receiverDecorator()
76 return dynamic_cast<ReceiverDecorator const &>(*this);
78 SENF_WRAP_EXC(std::bad_cast)
81 prefix_ senf::emu::TransmitterDecorator & senf::emu::InterfaceDecorator::transmitterDecorator()
84 return dynamic_cast<TransmitterDecorator &>(*this);
86 SENF_WRAP_EXC(std::bad_cast)
89 prefix_ senf::emu::TransmitterDecorator const &
90 senf::emu::InterfaceDecorator::transmitterDecorator()
94 return dynamic_cast<TransmitterDecorator const &>(*this);
96 SENF_WRAP_EXC(std::bad_cast)
99 prefix_ bool senf::emu::InterfaceDecorator::canReceive()
102 return dynamic_cast<ReceiverDecorator const *>(this);
105 prefix_ bool senf::emu::InterfaceDecorator::canTransmit()
108 return dynamic_cast<TransmitterDecorator const *>(this);
111 prefix_ senf::emu::InterfaceDecorator::InterfaceDecorator(Interface & interface)
112 : interface_(interface)
115 //-/////////////////////////////////////////////////////////////////////////////////////////////////
122 // comment-column: 40
123 // c-file-style: "senf"
124 // indent-tabs-mode: nil
125 // ispell-local-dictionary: "american"
126 // compile-command: "scons -u test"