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 template mutable_constant<T, void, void, void>

boost::log::attributes::mutable_constant<T, void, void, void> — Specialization for unlocked case.

Synopsis

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

template<typename T> 
class mutable_constant<T, void, void, void> : public attribute {
public:
  // types
  typedef T value_type;  // The attribute value type. 

  // member classes/structs/unions

  // Factory implementation.

  class impl : public attribute::impl {
  public:

    // public member functions
    explicit impl(value_type const &);
    explicit impl(value_type &&);
    virtual attribute_value get_value();
    void set(value_type const &);
    void set(value_type &&);
    value_type get() const;
  };

  // public member functions
  explicit mutable_constant(value_type const &);
  explicit mutable_constant(value_type &&);
  explicit mutable_constant(cast_source const &);
  void set(value_type const &);
  void set(value_type &&);
  value_type get() const;

  // protected member functions
  impl * get_impl() const;
};

Description

This version of attribute does not perform thread synchronization to access the stored value.

mutable_constant public member functions

  1. explicit mutable_constant(value_type const & value);

    Constructor with the stored value initialization

  2. explicit mutable_constant(value_type && value);

    Constructor with the stored value initialization

  3. explicit mutable_constant(cast_source const & source);

    Constructor for casting support

  4. void set(value_type const & value);

    The method sets a new attribute value.

  5. void set(value_type && value);

    The method sets a new attribute value.

  6. value_type get() const;

    The method acquires the current attribute value.

mutable_constant protected member functions

  1. impl * get_impl() const;

    Returns:

    Pointer to the factory implementation


PrevUpHomeNext