|
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_type > | set_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_type & | find1 (const second_type &key) |
const first_type & | find1 (const second_type &key) const |
const second_type & | find2 (const first_type &key) const |
second_type & | find2 (const first_type &key) |
first_compare_type | first_compare () const |
rset & | operator= (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
Constructor & Destructor Documentation
rset |
( |
const rset< Type1, Type2, Type1Equality, Type2Equality > & |
rhs ) |
|
Member Function Documentation
rset& operator= |
( |
const rset< Type1, Type2, Type1Equality, Type2Equality > & |
rhs ) |
|
std::size_t size |
( |
) |
const |
|