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 StreamRegistry inline non-template implementation */
17 #include "StreamRegistry.ih"
20 #include <senf/Utils/TypeInfo.hh>
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 // senf::log::StreamRegistry
28 prefix_ senf::log::StreamRegistry::StreamRegistry()
31 prefix_ senf::log::StreamRegistry::iterator senf::log::StreamRegistry::begin()
33 return boost::make_transform_iterator(registry_.begin(),
34 ::__gnu_cxx::select1st<Registry::value_type>());
37 prefix_ senf::log::StreamRegistry::iterator senf::log::StreamRegistry::end()
39 return boost::make_transform_iterator(registry_.end(),
40 ::__gnu_cxx::select1st<Registry::value_type>());
43 prefix_ void senf::log::StreamRegistry::registerStream(detail::StreamBase const & stream)
45 registry_.insert( std::make_pair(stream.v_name(), &stream) );
48 prefix_ senf::log::detail::StreamBase const *
49 senf::log::StreamRegistry::lookup(std::string const & name)
51 Registry::iterator i (registry_.find(name));
52 return i == registry_.end() ? 0 : i->second;
55 //-/////////////////////////////////////////////////////////////////////////////////////////////////
56 // senf::log::detail::StreamBase
58 prefix_ senf::log::detail::StreamBase::StreamBase()
62 prefix_ std::string senf::log::detail::StreamBase::fullName()
65 return prettyName(typeid(*this));
68 prefix_ std::string senf::log::detail::StreamBase::v_name()
74 prefix_ void senf::log::detail::StreamBase::init()
76 senf::log::StreamRegistry::instance().registerStream(*this);
79 //-/////////////////////////////////////////////////////////////////////////////////////////////////
87 // c-file-style: "senf"
88 // indent-tabs-mode: nil
89 // ispell-local-dictionary: "american"
90 // compile-command: "scons -u test"