123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- #ifndef BOOST_LOG_SOURCES_CHANNEL_LOGGER_HPP_INCLUDED_
- #define BOOST_LOG_SOURCES_CHANNEL_LOGGER_HPP_INCLUDED_
- #include <boost/log/detail/config.hpp>
- #if !defined(BOOST_LOG_NO_THREADS)
- #include <boost/log/detail/light_rw_mutex.hpp>
- #endif
- #include <boost/log/sources/features.hpp>
- #include <boost/log/sources/basic_logger.hpp>
- #include <boost/log/sources/threading_models.hpp>
- #include <boost/log/sources/channel_feature.hpp>
- #include <boost/log/keywords/channel.hpp>
- #include <boost/log/detail/header.hpp>
- #ifdef BOOST_HAS_PRAGMA_ONCE
- #pragma once
- #endif
- namespace boost {
- BOOST_LOG_OPEN_NAMESPACE
- namespace sources {
- #ifndef BOOST_LOG_DOXYGEN_PASS
- #ifdef BOOST_LOG_USE_CHAR
- template< typename ChannelT = std::string >
- class channel_logger :
- public basic_composite_logger<
- char,
- channel_logger< ChannelT >,
- single_thread_model,
- features< channel< ChannelT > >
- >
- {
- typedef typename channel_logger::logger_base base_type;
- public:
- BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(channel_logger)
- explicit channel_logger(ChannelT const& channel) : base_type(keywords::channel = channel)
- {
- }
- };
- #if !defined(BOOST_LOG_NO_THREADS)
- template< typename ChannelT = std::string >
- class channel_logger_mt :
- public basic_composite_logger<
- char,
- channel_logger_mt< ChannelT >,
- multi_thread_model< boost::log::aux::light_rw_mutex >,
- features< channel< ChannelT > >
- >
- {
- typedef typename channel_logger_mt::logger_base base_type;
- public:
- BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(channel_logger_mt)
- explicit channel_logger_mt(ChannelT const& channel) : base_type(keywords::channel = channel)
- {
- }
- };
- #endif
- #endif
- #ifdef BOOST_LOG_USE_WCHAR_T
- template< typename ChannelT = std::wstring >
- class wchannel_logger :
- public basic_composite_logger<
- wchar_t,
- wchannel_logger< ChannelT >,
- single_thread_model,
- features< channel< ChannelT > >
- >
- {
- typedef typename wchannel_logger::logger_base base_type;
- public:
- BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(wchannel_logger)
- explicit wchannel_logger(ChannelT const& channel) : base_type(keywords::channel = channel)
- {
- }
- };
- #if !defined(BOOST_LOG_NO_THREADS)
- template< typename ChannelT = std::wstring >
- class wchannel_logger_mt :
- public basic_composite_logger<
- wchar_t,
- wchannel_logger< ChannelT >,
- multi_thread_model< boost::log::aux::light_rw_mutex >,
- features< channel< ChannelT > >
- >
- {
- typedef typename wchannel_logger_mt::logger_base base_type;
- public:
- BOOST_LOG_FORWARD_LOGGER_MEMBERS_TEMPLATE(wchannel_logger_mt)
- explicit wchannel_logger_mt(ChannelT const& channel) : base_type(keywords::channel = channel)
- {
- }
- };
- #endif
- #endif
- #else
- template< typename ChannelT = std::string >
- class channel_logger :
- public basic_composite_logger<
- char,
- channel_logger< ChannelT >,
- single_thread_model,
- features< channel< ChannelT > >
- >
- {
- public:
-
- channel_logger();
-
- channel_logger(channel_logger const& that);
-
- template< typename... ArgsT >
- explicit channel_logger(ArgsT... const& args);
-
- explicit channel_logger(ChannelT const& channel);
-
- channel_logger& operator= (channel_logger const& that)
-
- void swap(channel_logger& that);
- };
- template< typename ChannelT = std::string >
- class channel_logger_mt :
- public basic_composite_logger<
- char,
- channel_logger_mt< ChannelT >,
- multi_thread_model< implementation_defined >,
- features< channel< ChannelT > >
- >
- {
- public:
-
- channel_logger_mt();
-
- channel_logger_mt(channel_logger_mt const& that);
-
- template< typename... ArgsT >
- explicit channel_logger_mt(ArgsT... const& args);
-
- explicit channel_logger_mt(ChannelT const& channel);
-
- channel_logger_mt& operator= (channel_logger_mt const& that)
-
- void swap(channel_logger_mt& that);
- };
- template< typename ChannelT = std::wstring >
- class wchannel_logger :
- public basic_composite_logger<
- wchar_t,
- wchannel_logger< ChannelT >,
- single_thread_model,
- features< channel< ChannelT > >
- >
- {
- public:
-
- wchannel_logger();
-
- wchannel_logger(wchannel_logger const& that);
-
- template< typename... ArgsT >
- explicit wchannel_logger(ArgsT... const& args);
-
- explicit wchannel_logger(ChannelT const& channel);
-
- wchannel_logger& operator= (wchannel_logger const& that)
-
- void swap(wchannel_logger& that);
- };
- template< typename ChannelT = std::wstring >
- class wchannel_logger_mt :
- public basic_composite_logger<
- wchar_t,
- wchannel_logger< ChannelT >,
- multi_thread_model< implementation_defined >,
- features< channel< ChannelT > >
- >
- {
- public:
-
- wchannel_logger_mt();
-
- wchannel_logger_mt(wchannel_logger_mt const& that);
-
- template< typename... ArgsT >
- explicit wchannel_logger_mt(ArgsT... const& args);
-
- explicit wchannel_logger_mt(ChannelT const& channel);
-
- wchannel_logger_mt& operator= (wchannel_logger_mt const& that)
-
- void swap(wchannel_logger_mt& that);
- };
- #endif
- }
- BOOST_LOG_CLOSE_NAMESPACE
- }
- #include <boost/log/detail/footer.hpp>
- #endif
|