Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class current_thread_id

boost::log::attributes::current_thread_id — A class of an attribute that always returns the current thread identifier.

Synopsis

// In header: <boost/log/attributes/current_thread_id.hpp>


class current_thread_id : public attribute {
public:
  // types
  typedef thread_id value_type;  // A held attribute value type. 

  // member classes/structs/unions

  // Factory implementation.

  class impl : public attribute_value::impl {
  public:

    // public member functions
    virtual bool dispatch(type_dispatcher &);
    virtual intrusive_ptr< attribute_value::impl > detach_from_thread();
    virtual typeindex::type_index get_type() const;
  };

  // public member functions
  current_thread_id();
  explicit current_thread_id(cast_source const &);
};

Description

[Note] Note

This attribute can be registered globally, it will still return the correct thread identifier, no matter which thread emits the log record.

current_thread_id public member functions

  1. current_thread_id();

    Default constructor

  2. explicit current_thread_id(cast_source const & source);

    Constructor for casting support


PrevUpHomeNext