| item0_base | The type of an item #0. | |
| item1_base | The type of an item #1. |
Public Types | |
| typedef item0_base | item0_type |
| The type representing an item #0. | |
| typedef item1_base | item1_type |
| The type representing an item #1. | |
|
typedef std::pair< item0_type, item1_type > | elem_type |
| The type representing a pair of items. | |
| typedef std::vector< elem_type > | inverse_map_type |
| The type implementing a vector of pairs of items. | |
| typedef inverse_map_type::size_type | value_type |
| The type representing a unique identifier. | |
|
typedef UNORDERED_MAP< elem_type, value_type > | forward_map_type |
| The type associating a pair of items to its unique identifier. | |
Public Member Functions | |
| quark2_base () | |
| Constructs the object. | |
| virtual | ~quark2_base () |
| Destructs the object. | |
| value_type | size () const |
| Returns the number of item-identifier associations. | |
| bool | exists (const item0_type &x, const item1_base &y) const |
| Tests whether a pair of items has an identifier assigned. | |
| value_type | operator() (const item0_type &x, const item1_base &y) |
| Assigns the unique identifier for a pair of items. | |
| value_type | associate (const item0_type &x, const item1_base &y) |
| Assigns the unique identifier for a pair of items. | |
| value_type | to_value (const item0_type &x, const item1_type &y) const |
| Returns the unique identifier for a pair of items. | |
| value_type | to_value (const item0_type &x, const item1_type &y, const value_type &def) const |
| Returns the unique identifier for a pair of items. | |
| void | to_item (const value_type &v, item0_type &x, item1_base &y) const |
| Returns the pair for the unique identifier. | |
Protected Attributes | |
| forward_map_type | m_fwd |
| Forward mapping: (item0, item1) -> value. | |
| inverse_map_type | m_inv |
| Inverse mapping: value -> (item0, item1). | |
| value_type classias::quark2_base< item0_base, item1_base >::size | ( | ) | const [inline] |
Returns the number of item-identifier associations.
| value_type | The number of associations between items and identifiers. |
| bool classias::quark2_base< item0_base, item1_base >::exists | ( | const item0_type & | x, | |
| const item1_base & | y | |||
| ) | const [inline] |
Tests whether a pair of items has an identifier assigned.
| x | The item #0. | |
| y | The item #1. |
| bool | true if the pair of items is known. |
| value_type classias::quark2_base< item0_base, item1_base >::operator() | ( | const item0_type & | x, | |
| const item1_base & | y | |||
| ) | [inline] |
Assigns the unique identifier for a pair of items.
If the pair is unknown, this function assigns a new unique identifier to the pair and return it. If the item is known, this function returns the existing identifier that was associated with the item.
| x | The item #0. | |
| y | The item #1. |
| value_type classias::quark2_base< item0_base, item1_base >::associate | ( | const item0_type & | x, | |
| const item1_base & | y | |||
| ) | [inline] |
Assigns the unique identifier for a pair of items.
If the pair is unknown, this function assigns a new unique identifier to the pair and return it. If the item is known, this function returns the existing identifier that was associated with the item.
| x | The item #0. | |
| y | The item #1. |
| value_type classias::quark2_base< item0_base, item1_base >::to_value | ( | const item0_type & | x, | |
| const item1_type & | y | |||
| ) | const [inline] |
Returns the unique identifier for a pair of items.
If the pair is unknown, this function throws quark_error.
| x | The item #0. | |
| y | The item #1. |
| quark_error. |
| value_type classias::quark2_base< item0_base, item1_base >::to_value | ( | const item0_type & | x, | |
| const item1_type & | y, | |||
| const value_type & | def | |||
| ) | const [inline] |
Returns the unique identifier for a pair of items.
If the pair is unknown, this function returns the default identifier.
| x | The item #0. | |
| y | The item #1. | |
| def | The default identifier if the pair is unknown. |
| void classias::quark2_base< item0_base, item1_base >::to_item | ( | const value_type & | v, | |
| item0_type & | x, | |||
| item1_base & | y | |||
| ) | const [inline] |
Returns the pair for the unique identifier.
If the unique identifier is unknown, this function throws quark_error.
| v | The unique identifier. | |
| x | The reference to item #0. | |
| y | The reference to item #1. |
| quark_error. |