Boost C++ Libraries

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 void mutex_type;         // Mutex type. 
  typedef void scoped_read_lock;   // Shared lock type. 
  typedef void scoped_write_lock;  // Exclusive lock type. 
  typedef T    held_type;          // A held constant type. 

  // public member functions
   mutable_constant(held_type const &);
  shared_ptr< attribute_value > get_value();
  void set_value(held_type const &);
};

Description

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

mutable_constant public member functions

  1.  mutable_constant(held_type const & value);

    Constructor with the stored value initialization

  2. shared_ptr< attribute_value > get_value();

    Returns:

    The actual attribute value. It shall not return NULL (exceptions shall be used to indicate errors).

  3. void set_value(held_type const & v);

    The method sets a new attribute value.


PrevUpHomeNext