Target.cti
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 
14 /** \file
15  \brief Target inline template implementation */
16 
17 #include "Target.ih"
18 
19 // Custom includes
20 #include "Levels.hh"
21 
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 // senf::log::Target
27 
28 // senf::log::Target::route
29 
30 #ifndef DOXYGEN
31 
32 template <class A1>
33 prefix_ void senf::log::Target::route(action_t action, int index)
34 {
35  route<A1,mpl::nil,mpl::nil>(action, index);
36 }
37 
38 template <class A1, class A2>
39 prefix_ void senf::log::Target::route(action_t action, int index)
40 {
41  route<A1,A2,mpl::nil>(action, index);
42 }
43 
44 template <class A1, class A2, class A3>
45 prefix_ void senf::log::Target::route(action_t action, int index)
46 {
47  typedef detail::RouteParameters<A1,A2,A3> Params;
48  route( detail::InstanceP<typename Params::Stream, detail::StreamBase>::value(),
49  detail::InstanceP<typename Params::Area, detail::AreaBase>::value(),
50  Params::Level::value,
51  action, index);
52 }
53 
54 template <class A1>
55 prefix_ void senf::log::Target::unroute(action_t action)
56 {
57  unroute<A1,mpl::nil,mpl::nil>(action);
58 }
59 
60 template <class A1, class A2>
61 prefix_ void senf::log::Target::unroute(action_t action)
62 {
63  unroute<A1,A2,mpl::nil>(action);
64 }
65 
66 template <class A1, class A2, class A3>
67 prefix_ void senf::log::Target::unroute(action_t action)
68 {
69  typedef detail::RouteParameters<A1,A2,A3> Params;
70  unroute( detail::InstanceP<typename Params::Stream, detail::StreamBase>::value(),
71  detail::InstanceP<typename Params::Area, detail::AreaBase>::value(),
72  Params::Level::value,
73  action);
74 }
75 
76 #endif
77 
78 //-/////////////////////////////////////////////////////////////////////////////////////////////////
79 // namespace senf::log::detail members
80 
81 template <class Stream, class Area, class Level>
82 prefix_ void senf::log::detail::write(std::string const & msg)
83 {
84  TargetRegistry::instance().write(Stream::instance(), Area::instance(), Level::value, msg);
85 }
86 
87 //-/////////////////////////////////////////////////////////////////////////////////////////////////
88 #undef prefix_
89 
90 
91 // Local Variables:
92 // mode: c++
93 // fill-column: 100
94 // comment-column: 40
95 // c-file-style: "senf"
96 // indent-tabs-mode: nil
97 // ispell-local-dictionary: "american"
98 // compile-command: "scons -u test"
99 // End: