Boost C++ Libraries

PrevUpHomeNext

Class template basic_channel_logger

boost::log::sources::basic_channel_logger — Channel feature implementation.

Synopsis

// In header: <boost/log/sources/channel_feature.hpp>

template<typename BaseT, typename ChannelT> 
class basic_channel_logger {
public:
  // types
  typedef base_type::char_type                                                                 char_type;           // Character type. 
  typedef base_type::final_type                                                                final_type;          // Final type. 
  typedef base_type::attribute_set_type                                                        attribute_set_type;  // Attribute set type. 
  typedef base_type::string_type                                                               string_type;         // String type. 
  typedef base_type::threading_model                                                           threading_model;     // Threading model being used. 
  typedef ChannelT                                                                             channel_type;        // Channel type. 
  typedef attributes::constant< channel_type >                                                 channel_attribute;   // Channel attribute type. 
  typedef strictest_lock< typename base_type::swap_lock, lock_guard< threading_model > >::type swap_lock;           // Lock requirement for the swap_unlocked method. 

  // construct/copy/destruct
  basic_channel_logger();
  basic_channel_logger(basic_channel_logger const &);
  template<typename ArgsT> explicit basic_channel_logger(ArgsT const &);

  // public member functions
  bool has_channel() const;
  channel_type const & channel() const;

  // protected member functions
  shared_ptr< channel_attribute > const & get_channel_attribute() const;
  void swap_unlocked(basic_channel_logger &);
};

Description

basic_channel_logger public construct/copy/destruct

  1. basic_channel_logger();

    Default constructor. The constructed logger does not have the channel attribute.

  2. basic_channel_logger(basic_channel_logger const & that);

    Copy constructor

  3. template<typename ArgsT> explicit basic_channel_logger(ArgsT const & args);

    Constructor with arguments. Allows to register a channel name attribute on construction.

    Parameters:
    args

    A set of named arguments. The following arguments are supported:

    • channel - a string that represents the channel name

basic_channel_logger public member functions

  1. bool has_channel() const;

    The observer of the channel attribute presence

    Returns:

    true if the channel attribute is set by the logger, false otherwise

  2. channel_type const & channel() const;

    The observer of the channel name

    Requires:

    this->has_channel() == true

    Returns:

    The channel name that was set by the logger

basic_channel_logger protected member functions

  1. shared_ptr< channel_attribute > const & get_channel_attribute() const;

    Channel attribute accessor

  2. void swap_unlocked(basic_channel_logger & that);

    Unlocked swap


PrevUpHomeNext