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 InterfaceAPI inline template implementation */
19 #define prefix_ inline
20 //-/////////////////////////////////////////////////////////////////////////////////////////////////
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 // senf::emu::detail::InterfaceAccess<Interface>
25 template <class Interface>
26 prefix_ senf::emu::detail::InterfaceAccess<Interface>::~InterfaceAccess()
29 template <class Interface>
30 prefix_ Interface & senf::emu::detail::InterfaceAccess<Interface>::interface()
33 return dynamic_cast<Interface &>(*this);
35 SENF_WRAP_EXC(std::bad_cast)
38 template <class Interface>
39 prefix_ Interface const & senf::emu::detail::InterfaceAccess<Interface>::interface()
43 return dynamic_cast<Interface const &>(*this);
45 SENF_WRAP_EXC(std::bad_cast)
48 //-/////////////////////////////////////////////////////////////////////////////////////////////////
49 // senf::emu::detail::CommfaceAccess<Receiver,Transmitter>
51 template <class Receiver, class Transmitter>
52 prefix_ senf::emu::detail::CommfaceAccess<Receiver,Transmitter>::~CommfaceAccess()
55 template <class Receiver, class Transmitter>
56 prefix_ Receiver & senf::emu::detail::CommfaceAccess<Receiver,Transmitter>::receiver()
59 return dynamic_cast<Receiver &>(*this);
61 SENF_WRAP_EXC(std::bad_cast)
64 template <class Receiver, class Transmitter>
65 prefix_ Receiver const & senf::emu::detail::CommfaceAccess<Receiver,Transmitter>::receiver()
69 return dynamic_cast<Receiver const &>(*this);
71 SENF_WRAP_EXC(std::bad_cast)
74 template <class Receiver, class Transmitter>
75 prefix_ Transmitter & senf::emu::detail::CommfaceAccess<Receiver,Transmitter>::transmitter()
78 return dynamic_cast<Transmitter &>(*this);
80 SENF_WRAP_EXC(std::bad_cast)
83 template <class Receiver, class Transmitter>
84 prefix_ Transmitter const &
85 senf::emu::detail::CommfaceAccess<Receiver,Transmitter>::transmitter()
89 return dynamic_cast<Transmitter const &>(*this);
91 SENF_WRAP_EXC(std::bad_cast)
94 //-/////////////////////////////////////////////////////////////////////////////////////////////////
101 // comment-column: 40
102 // c-file-style: "senf"
103 // indent-tabs-mode: nil
104 // ispell-local-dictionary: "american"
105 // compile-command: "scons -u test"