ATLAS Offline Software
Public Types | Static Public Member Functions | Private Types | Private Member Functions | List of all members
SG::MapIndexingPolicy< MAP > Class Template Reference

Indexing policy for a map-like container. More...

#include <MapIndexingPolicy.h>

Collaboration diagram for SG::MapIndexingPolicy< MAP >:

Public Types

typedef type_tools::Copy< mapped_type >::type ElementType
 The type we get when we dereference a link, and derived types. More...
 
typedef type_tools::Copy< mapped_type >::const_reference ElementConstReference
 
typedef type_tools::Copy< mapped_type >::const_pointer ElementConstPointer
 
typedef MAP::key_type index_type
 The type of an index, as provided to or returned from a link. More...
 
typedef SG::IndexHolder< index_typestored_index_type
 The type of an index, as stored internally within a link. More...
 

Static Public Member Functions

static bool isValid (const stored_index_type &index)
 Test to see if an index is valid. More...
 
static index_type storedToExternal (stored_index_type index)
 Convert from stored to external index types. More...
 
static void reset (stored_index_type &index)
 Make an index invalid. More...
 
static ElementType lookup (const stored_index_type &index, const MAP &data)
 Retrieve from a container the element corresponding to an index. More...
 
static void reverseLookup (const MAP &data, ElementConstReference element, index_type &index)
 Find the index of the (first) instance of ELEMENT in DATA. More...
 

Private Types

typedef MAP::mapped_type mapped_type
 
typedef MAP::const_iterator const_iterator
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((boost::PairAssociativeContainerConcept< MAP >))
 

Detailed Description

template<class MAP>
class SG::MapIndexingPolicy< MAP >

Indexing policy for a map-like container.

See ElementLinkTraits.h for a summary of the requirements for an indexing policy.

Indexes here are use IndexHolder, with the key of the container as the payload. The type returned from the link is the second type of the map.

Definition at line 47 of file MapIndexingPolicy.h.

Member Typedef Documentation

◆ const_iterator

template<class MAP >
typedef MAP::const_iterator SG::MapIndexingPolicy< MAP >::const_iterator
private

Definition at line 54 of file MapIndexingPolicy.h.

◆ ElementConstPointer

template<class MAP >
typedef type_tools::Copy<mapped_type>::const_pointer SG::MapIndexingPolicy< MAP >::ElementConstPointer

Definition at line 61 of file MapIndexingPolicy.h.

◆ ElementConstReference

template<class MAP >
typedef type_tools::Copy<mapped_type>::const_reference SG::MapIndexingPolicy< MAP >::ElementConstReference

Definition at line 60 of file MapIndexingPolicy.h.

◆ ElementType

template<class MAP >
typedef type_tools::Copy<mapped_type>::type SG::MapIndexingPolicy< MAP >::ElementType

The type we get when we dereference a link, and derived types.

Definition at line 59 of file MapIndexingPolicy.h.

◆ index_type

template<class MAP >
typedef MAP::key_type SG::MapIndexingPolicy< MAP >::index_type

The type of an index, as provided to or returned from a link.

Definition at line 64 of file MapIndexingPolicy.h.

◆ mapped_type

template<class MAP >
typedef MAP::mapped_type SG::MapIndexingPolicy< MAP >::mapped_type
private

Definition at line 53 of file MapIndexingPolicy.h.

◆ stored_index_type

template<class MAP >
typedef SG::IndexHolder<index_type> SG::MapIndexingPolicy< MAP >::stored_index_type

The type of an index, as stored internally within a link.

Definition at line 67 of file MapIndexingPolicy.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<class MAP >
SG::MapIndexingPolicy< MAP >::BOOST_CONCEPT_ASSERT ( (boost::PairAssociativeContainerConcept< MAP >)  )
private

◆ isValid()

template<class MAP >
static bool SG::MapIndexingPolicy< MAP >::isValid ( const stored_index_type index)
static

Test to see if an index is valid.

Parameters
indexThe index to test.

◆ lookup()

template<class MAP >
static ElementType SG::MapIndexingPolicy< MAP >::lookup ( const stored_index_type index,
const MAP &  data 
)
static

Retrieve from a container the element corresponding to an index.

Parameters
indexThe index to fetch.
dataThe container.

Will throw SG::ExcInvalidIndex if the index is invalid and SG::ExcIndexNotFound if the index is not in the container.

◆ reset()

template<class MAP >
static void SG::MapIndexingPolicy< MAP >::reset ( stored_index_type index)
static

Make an index invalid.

Parameters
index[out]The index to reset.

◆ reverseLookup()

template<class MAP >
static void SG::MapIndexingPolicy< MAP >::reverseLookup ( const MAP &  data,
ElementConstReference  element,
index_type index 
)
static

Find the index of the (first) instance of ELEMENT in DATA.

Parameters
dataThe container to search.
elementThe element to find.
index[out]The index in the container of element.

Throws SG::ExcElementNotFound if the element is not in the container.

◆ storedToExternal()

template<class MAP >
static index_type SG::MapIndexingPolicy< MAP >::storedToExternal ( stored_index_type  index)
static

Convert from stored to external index types.

Parameters
indexThe stored index.

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