Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::attribute Class Reference

A base class for an attribute value factory. More...

#include <attribute.hpp>

Inheritance diagram for boost::attribute:

Classes

struct  impl
 A base class for an attribute value factory. More...
 

Public Member Functions

 attribute (attribute const &that) BOOST_NOEXCEPT
 Default constructor. More...
 
 attribute (BOOST_RV_REF(attribute) that) BOOST_NOEXCEPT
 Move constructor. More...
 
 attribute (intrusive_ptr< impl > p) BOOST_NOEXCEPT
 Initializing constructor. More...
 
attributeoperator= (BOOST_COPY_ASSIGN_REF(attribute) that) BOOST_NOEXCEPT
 Copy assignment. More...
 
attributeoperator= (BOOST_RV_REF(attribute) that) BOOST_NOEXCEPT
 Move assignment. More...
 
attributeoperator= (aux::attribute_set_reference_proxy const &that) BOOST_NOEXCEPT
 
bool operator! () const BOOST_NOEXCEPT
 Verifies that the factory is not in empty state. More...
 
attribute_value get_value () const
 
void swap (attribute &that) BOOST_NOEXCEPT
 The method swaps two factories (i.e. More...
 

Protected Member Functions

implget_impl () const BOOST_NOEXCEPT
 
void set_impl (intrusive_ptr< impl > p) BOOST_NOEXCEPT
 Sets the pointer to the factory implementation. More...
 

Friends

template<typename T >
T attribute_cast (attribute const &)
 The function casts one attribute factory to another. More...
 

Detailed Description

A base class for an attribute value factory.

Every attribute is represented with a factory that is basically an attribute value generator. The sole purpose of an attribute is to return an actual value when requested. A simplest attribute can always return the same value that it stores internally, but more complex ones can perform a considerable amount of work to return a value, and the returned values may differ each time requested.

A word about thread safety. An attribute should be prepared to be requested a value from multiple threads concurrently.

Constructor & Destructor Documentation

boost::attribute::attribute ( attribute const &  that)
inline

Default constructor.

Creates an empty attribute value factory, which is not usable until set_impl is called.

Copy constructor

boost::attribute::attribute ( BOOST_RV_REF(attribute that)
inline

Move constructor.

References boost::intrusive_ptr< T >::swap().

boost::attribute::attribute ( intrusive_ptr< impl p)
inlineexplicit

Initializing constructor.

Parameters
pPointer to the implementation. Must not be NULL.

References boost::multiprecision::backends::p, and boost::intrusive_ptr< T >::swap().

Member Function Documentation

attribute_value boost::attribute::get_value ( ) const
Returns
The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors).
bool boost::attribute::operator! ( ) const
inline

Verifies that the factory is not in empty state.

Verifies that the factory is in empty state

attribute& boost::attribute::operator= ( BOOST_COPY_ASSIGN_REF(attribute that)
inline
attribute& boost::attribute::operator= ( BOOST_RV_REF(attribute that)
inline

Move assignment.

References boost::intrusive_ptr< T >::swap().

attribute & boost::attribute::operator= ( aux::attribute_set_reference_proxy const &  that)
inline
void boost::attribute::set_impl ( intrusive_ptr< impl p)
inlineprotected

Sets the pointer to the factory implementation.

Parameters
pPointer to the implementation. Must not be NULL.

References boost::multiprecision::backends::p, and boost::intrusive_ptr< T >::swap().

Referenced by boost::attributes::counter< T >::counter().

void boost::attribute::swap ( attribute that)
inline

Friends And Related Function Documentation

template<typename T >
T attribute_cast ( attribute const &  attr)
friend

The function casts one attribute factory to another.


The documentation for this class was generated from the following files: