stlab.adobe.com Adobe Systems Incorporated

rset< Type1, Type2, Type1Equality, Type2Equality > Class Template Reference
[User-Supported (Platform) Libraries]

A bidirectional lookup table intended for a small set of elements. More...

#include <rset.hpp>

List of all members.

Public Types

typedef set_type::const_iterator const_iterator
typedef set_type::const_reference const_reference
typedef Type1Equality first_compare_type
typedef Type1 first_type
typedef set_type::iterator iterator
typedef set_type::reference reference
typedef Type2Equality second_compare_type
typedef Type2 second_type
typedef std::vector< value_typeset_type
typedef std::pair< first_type,
second_type
value_type

Public Member Functions

reference at (std::size_t n)
const_reference at (std::size_t n) const
iterator begin ()
const_iterator begin () const
bool empty () const
iterator end ()
const_iterator end () const
first_typefind1 (const second_type &key)
const first_typefind1 (const second_type &key) const
const second_typefind2 (const first_type &key) const
second_typefind2 (const first_type &key)
first_compare_type first_compare () const
rsetoperator= (const rset &rhs)
const boost::disable_if
< boost::is_same< first_type,
second_type >, first_type >
::type & 
operator[] (const second_type &key) const
boost::disable_if
< boost::is_same< first_type,
second_type >, second_type >
::type & 
operator[] (const first_type &key)
const boost::disable_if
< boost::is_same< first_type,
second_type >, second_type >
::type & 
operator[] (const first_type &key) const
boost::disable_if
< boost::is_same< first_type,
second_type >, first_type >
::type & 
operator[] (const second_type &key)
void push_back (const value_type &value)
void push_back (const first_type &first, const second_type &second)
 rset (const rset &rhs)
 rset ()
second_compare_type second_compare () const
std::size_t size () const

Detailed Description

template<typename Type1, typename Type2, typename Type1Equality = std::equal_to<Type1>, typename Type2Equality = std::equal_to<Type2>>
class adobe::rset< Type1, Type2, Type1Equality, Type2Equality >

rset (reversible set) allows the client to specify a set of one-to-one relationships between values of different types. The client is then able to search on any value in either type to retrieve the corresponding value in the other type. The two base types can be the same. When they are not, additional syntactic sugar is enabled to make for prettier code.

Note:
Boost has a library that is far more robust than this one, with an extensive set of features beyond what rset has to offer. However, for relatively small sets, this container can prove faster than a more heavyweight counterpart. (See http://www.boost.org/libs/multi_index/doc/index.html)

Definition at line 51 of file rset.hpp.


Member Typedef Documentation

typedef set_type::const_iterator const_iterator

Definition at line 61 of file rset.hpp.

typedef set_type::const_reference const_reference

Definition at line 63 of file rset.hpp.

typedef Type1Equality first_compare_type

Definition at line 56 of file rset.hpp.

typedef Type1 first_type

Definition at line 54 of file rset.hpp.

typedef set_type::iterator iterator

Definition at line 60 of file rset.hpp.

typedef set_type::reference reference

Definition at line 62 of file rset.hpp.

typedef Type2Equality second_compare_type

Definition at line 57 of file rset.hpp.

typedef Type2 second_type

Definition at line 55 of file rset.hpp.

typedef std::vector<value_type> set_type

Definition at line 59 of file rset.hpp.

typedef std::pair<first_type, second_type> value_type

Definition at line 58 of file rset.hpp.


Constructor & Destructor Documentation

rset (  )

Definition at line 65 of file rset.hpp.

rset ( const rset< Type1, Type2, Type1Equality, Type2Equality > &  rhs )

Definition at line 70 of file rset.hpp.


Member Function Documentation

reference at ( std::size_t  n )

Definition at line 103 of file rset.hpp.

const_reference at ( std::size_t  n ) const

Definition at line 104 of file rset.hpp.

const_iterator begin (  ) const

Definition at line 100 of file rset.hpp.

iterator begin (  )

Definition at line 97 of file rset.hpp.

bool empty (  ) const

Definition at line 88 of file rset.hpp.

iterator end (  )

Definition at line 98 of file rset.hpp.

const_iterator end (  ) const

Definition at line 101 of file rset.hpp.

first_type& find1 ( const second_type key )

Definition at line 106 of file rset.hpp.

const first_type& find1 ( const second_type key ) const

Definition at line 115 of file rset.hpp.

second_type& find2 ( const first_type key )

Definition at line 118 of file rset.hpp.

const second_type& find2 ( const first_type key ) const

Definition at line 127 of file rset.hpp.

first_compare_type first_compare (  ) const

Definition at line 85 of file rset.hpp.

rset& operator= ( const rset< Type1, Type2, Type1Equality, Type2Equality > &  rhs )

Definition at line 76 of file rset.hpp.

boost::disable_if<boost::is_same<first_type, second_type>, first_type>::type& operator[] ( const second_type key )

Definition at line 139 of file rset.hpp.

boost::disable_if<boost::is_same<first_type, second_type>, second_type>::type& operator[] ( const first_type key )

Definition at line 131 of file rset.hpp.

const boost::disable_if<boost::is_same<first_type, second_type>, second_type>::type& operator[] ( const first_type key ) const

Definition at line 135 of file rset.hpp.

const boost::disable_if<boost::is_same<first_type, second_type>, first_type>::type& operator[] ( const second_type key ) const

Definition at line 143 of file rset.hpp.

void push_back ( const value_type value )

Definition at line 91 of file rset.hpp.

void push_back ( const first_type first,
const second_type second 
)

Definition at line 94 of file rset.hpp.

second_compare_type second_compare (  ) const

Definition at line 86 of file rset.hpp.

std::size_t size (  ) const

Definition at line 89 of file rset.hpp.

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google