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

The class represents an attribute name in containers used by the library. More...

#include <attribute_name.hpp>

Public Types

typedef std::string string_type
 String type. More...
 
typedef uint32_t id_type
 

Public Member Functions

BOOST_CONSTEXPR attribute_name () BOOST_NOEXCEPT
 Default constructor. More...
 
 attribute_name (const char *name)
 Constructs an attribute name from the specified string. More...
 
 attribute_name (string_type const &name)
 Constructs an attribute name from the specified string. More...
 
bool operator== (attribute_name const &that) const BOOST_NOEXCEPT
 Compares the attribute names. More...
 
bool operator!= (attribute_name const &that) const BOOST_NOEXCEPT
 Compares the attribute names. More...
 
bool operator== (const char *that) const
 Compares the attribute names. More...
 
bool operator!= (const char *that) const
 Compares the attribute names. More...
 
bool operator== (string_type const &that) const
 Compares the attribute names. More...
 
bool operator!= (string_type const &that) const
 Compares the attribute names. More...
 
bool operator! () const BOOST_NOEXCEPT
 Checks if the object was default-constructed. More...
 
id_type id () const BOOST_NOEXCEPT
 
string_type const & string () const
 

Friends

class repository
 

Detailed Description

The class represents an attribute name in containers used by the library.

The class mostly serves for optimization purposes. Each attribute name that is used with the library is automatically associated with a unique identifier, which is much lighter in terms of memory footprint and operations complexity. This is done transparently by this class, on object construction. Passing objects of this class to other library methods, such as attribute lookup functions, will not require this translation and/or string copying and thus will result in a more efficient code.

Member Typedef Documentation

String type.

Constructor & Destructor Documentation

BOOST_CONSTEXPR boost::attribute_name::attribute_name ( )
inline

Default constructor.

Creates an object that does not refer to any attribute name.

boost::attribute_name::attribute_name ( const char *  name)
inline

Constructs an attribute name from the specified string.

Parameters
nameAn attribute name
Precondition
name is not NULL and points to a zero-terminated string
boost::attribute_name::attribute_name ( string_type const &  name)
inline

Constructs an attribute name from the specified string.

Parameters
nameAn attribute name

Member Function Documentation

id_type boost::attribute_name::id ( ) const
inline
Returns
The associated id value
Precondition
(!*this) == false

References BOOST_ASSERT, and boost::future_state::uninitialized.

bool boost::attribute_name::operator! ( ) const
inline

Checks if the object was default-constructed.

Returns
true if *this was constructed with an attribute name, false otherwise

Checks if the object was default-constructed

Returns
true if *this was default-constructed and does not refer to any attribute name, false otherwise

References boost::future_state::uninitialized.

bool boost::attribute_name::operator!= ( attribute_name const &  that) const
inline

Compares the attribute names.

Returns
true if *this and that refer to different attribute names, and false otherwise.
bool boost::attribute_name::operator!= ( const char *  that) const
inline

Compares the attribute names.

Returns
true if *this and that refer to different attribute names, and false otherwise.

References operator==().

bool boost::attribute_name::operator!= ( string_type const &  that) const
inline

Compares the attribute names.

Returns
true if *this and that refer to different attribute names, and false otherwise.

References operator==().

bool boost::attribute_name::operator== ( attribute_name const &  that) const
inline

Compares the attribute names.

Returns
true if *this and that refer to the same attribute name, and false otherwise.

Referenced by operator!=().

bool boost::attribute_name::operator== ( const char *  that) const
inline

Compares the attribute names.

Returns
true if *this and that refer to the same attribute name, and false otherwise.

References string(), and boost::future_state::uninitialized.

bool boost::attribute_name::operator== ( string_type const &  that) const
inline

Compares the attribute names.

Returns
true if *this and that refer to the same attribute name, and false otherwise.

References string(), and boost::future_state::uninitialized.

string_type const& boost::attribute_name::string ( ) const
inline
Returns
The attribute name string that was used during the object construction
Precondition
(!*this) == false

Referenced by operator==().

Friends And Related Function Documentation

friend class repository
friend

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