ATLAS Offline Software
Public Types | Static Public Member Functions | Private Types | Static Private Attributes | List of all members
SG::ForwardIndexingPolicy< CONT, VALUE_TYPE > Class Template Reference

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

#include <ForwardIndexingPolicy.h>

Collaboration diagram for SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >:

Public Types

typedef type_tools::Copy< value_type >::type ElementType
 The type we get when we dereference a link, and derived types. More...
 
typedef type_tools::Copy< value_type >::const_reference ElementConstReference
 
typedef type_tools::Copy< value_type >::const_pointer ElementConstPointer
 
typedef size_t index_type
 The type of an index, as provided to or returned from a link. More...
 
typedef uint32_t stored_index_type
 The type of an index, as stored internally within a link. More...
 

Static Public Member Functions

static bool isValid (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 (index_type index, const CONT &data)
 Retrieve from a container the element corresponding to an index. More...
 
static void reverseLookup (const CONT &data, ElementConstReference element, index_type &index)
 Find the index of the (first) instance of ELEMENT in DATA. More...
 

Private Types

typedef VALUE_TYPE value_type
 

Static Private Attributes

static const index_type INVALID = static_cast<index_type> (-1)
 Value to mark an invalid index. More...
 

Detailed Description

template<class CONT, class VALUE_TYPE = typename CONT::value_type>
class SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >

Indexing policy for a vector-like container.

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

Indexes here are size_type, with -1 used to mark an invalid index.

Definition at line 41 of file ForwardIndexingPolicy.h.

Member Typedef Documentation

◆ ElementConstPointer

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
typedef type_tools::Copy<value_type>::const_pointer SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::ElementConstPointer

Definition at line 51 of file ForwardIndexingPolicy.h.

◆ ElementConstReference

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
typedef type_tools::Copy<value_type>::const_reference SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::ElementConstReference

Definition at line 50 of file ForwardIndexingPolicy.h.

◆ ElementType

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
typedef type_tools::Copy<value_type>::type SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::ElementType

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

Definition at line 49 of file ForwardIndexingPolicy.h.

◆ index_type

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
typedef size_t SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::index_type

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

Definition at line 54 of file ForwardIndexingPolicy.h.

◆ stored_index_type

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
typedef uint32_t SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::stored_index_type

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

Definition at line 57 of file ForwardIndexingPolicy.h.

◆ value_type

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
typedef VALUE_TYPE SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::value_type
private

Definition at line 44 of file ForwardIndexingPolicy.h.

Member Function Documentation

◆ isValid()

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
static bool SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::isValid ( stored_index_type  index)
static

Test to see if an index is valid.

Parameters
indexThe index to test.

◆ lookup()

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
static ElementType SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::lookup ( index_type  index,
const CONT &  data 
)
static

Retrieve from a container the element corresponding to an index.

Parameters
indexThe index to fetch.
dataThe container.

Will throw SG::ExcBadForwardLink if the index is invalid.

◆ reset()

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
static void SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::reset ( stored_index_type index)
static

Make an index invalid.

Parameters
index[out]The index to reset.

◆ reverseLookup()

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
static void SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::reverseLookup ( const CONT &  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 CONT , class VALUE_TYPE = typename CONT::value_type>
static index_type SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::storedToExternal ( stored_index_type  index)
static

Convert from stored to external index types.

Parameters
indexThe stored index.

Member Data Documentation

◆ INVALID

template<class CONT , class VALUE_TYPE = typename CONT::value_type>
const index_type SG::ForwardIndexingPolicy< CONT, VALUE_TYPE >::INVALID = static_cast<index_type> (-1)
staticprivate

Value to mark an invalid index.

Definition at line 62 of file ForwardIndexingPolicy.h.


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