A class of an attribute that holds a single constant value with ability to change it.
More...
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
class boost::attributes::mutable_constant< T, MutexT, ScopedWriteLockT, ScopedReadLockT >
A class of an attribute that holds a single constant value with ability to change it.
The mutable_constant attribute stores a single value of type, specified as the first template argument. This value is returned on each attribute value acquisition.
The attribute also allows to modify the stored value, even if the attribute is registered in an attribute set. In order to ensure thread safety of such modifications the mutable_constant
class is also parametrized with three additional template arguments: mutex type, scoped write and scoped read lock types. If not specified, the lock types are automatically deduced based on the mutex type.
The implementation may avoid using these types to actually create and use the mutex, if a more efficient synchronization method is available (such as atomic operations on the value type). By default no synchronization is done.
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
The attribute value type.
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
Constructor with the stored value initialization.
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
Constructor with the stored value initialization.
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
Constructor for casting support.
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
The method acquires the current attribute value.
The implementation non-exclusively locks the mutex in order to protect the value acquisition.
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
The method sets a new attribute value.
The implementation exclusively locks the mutex in order to protect the value assignment.
template<typename T, typename MutexT = void, typename ScopedWriteLockT = typename mpl::if_c< boost::log::aux::is_exclusively_lockable< MutexT >::value, boost::log::aux::exclusive_lock_guard< MutexT >, void >::type, typename ScopedReadLockT = typename mpl::if_c< boost::log::aux::is_shared_lockable< MutexT >::value, boost::log::aux::shared_lock_guard< MutexT >, ScopedWriteLockT >::type>
The method sets a new attribute value.