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 Callback inline template implementation */
17 //#include "Callback.ih"
20 #include <boost/bind.hpp>
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 // senf::ppi::detail::Callback<Arg>
29 template <class Owner, class FnClass>
30 prefix_ typename senf::ppi::detail::Callback<Arg>::type
31 senf::ppi::detail::Callback<Arg>::make(void (FnClass::* memfn )(), Owner & owner)
33 return boost::bind(memfn,static_cast<FnClass *>(&owner));
37 template <class Owner, class FnClass, class FnArg>
38 prefix_ typename senf::ppi::detail::Callback<Arg>::type
39 senf::ppi::detail::Callback<Arg>::make(void (FnClass::* memfn )(FnArg arg), Owner & owner)
41 return boost::bind(memfn,static_cast<FnClass *>(&owner),_1);
45 template <class Owner>
46 prefix_ typename senf::ppi::detail::Callback<Arg>::type
47 senf::ppi::detail::Callback<Arg>::make(type callable, Owner &)
53 template <class Owner>
54 prefix_ typename senf::ppi::detail::Callback<Arg>::type
55 senf::ppi::detail::Callback<Arg>::make(boost::function<void()> callable, Owner &)
57 return boost::bind(callable);
60 //-/////////////////////////////////////////////////////////////////////////////////////////////////
61 // senf::ppi::detail::Callback<void>
63 template <class Owner, class FnClass>
64 prefix_ typename senf::ppi::detail::Callback<void>::type
65 senf::ppi::detail::Callback<void>::make(void (FnClass::* memfn )(), Owner & owner)
67 return boost::bind(memfn,static_cast<FnClass *>(&owner));
70 template <class Owner>
71 prefix_ typename senf::ppi::detail::Callback<void>::type
72 senf::ppi::detail::Callback<void>::make(type callable, Owner &)
77 //-/////////////////////////////////////////////////////////////////////////////////////////////////
85 // c-file-style: "senf"
86 // indent-tabs-mode: nil
87 // ispell-local-dictionary: "american"
88 // compile-command: "scons -u ../test"