Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Static Public Member Functions | Private Types | List of all members
SG::IdentContIndexingPolicy< CONT > Class Template Reference

Indexing policy for an IdentifiableContainer. More...

#include <IdentContIndexingPolicy.h>

Collaboration diagram for SG::IdentContIndexingPolicy< CONT >:

Public Types

typedef type_tools::Copy< obj_type >::type ElementType
 The type we get when we dereference a link, and derived types. More...
 
typedef type_tools::Copy< obj_type >::const_reference ElementConstReference
 
typedef type_tools::Copy< obj_type >::const_pointer ElementConstPointer
 
typedef unsigned int index_type
 The type of an index, as provided to or returned from a link. More...
 
typedef index_type 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 CONT::IDENTIFIABLE coll_type
 
typedef coll_type::value_type obj_type
 

Detailed Description

template<class CONT>
class SG::IdentContIndexingPolicy< CONT >

Indexing policy for an IdentifiableContainer.

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

An identifiable container has a two-level index: the collection hash and the index within the collection. These are packed together in a 32-bit integer, which is what we expose as the index type. There's a value defined for an invalid index, so we don't need to use the IndexHolder wrapper. To unpack this index, use IdentContIndex.

Definition at line 39 of file IdentContIndexingPolicy.h.

Member Typedef Documentation

◆ coll_type

template<class CONT >
typedef CONT::IDENTIFIABLE SG::IdentContIndexingPolicy< CONT >::coll_type
private

Definition at line 42 of file IdentContIndexingPolicy.h.

◆ ElementConstPointer

template<class CONT >
typedef type_tools::Copy<obj_type>::const_pointer SG::IdentContIndexingPolicy< CONT >::ElementConstPointer

Definition at line 50 of file IdentContIndexingPolicy.h.

◆ ElementConstReference

template<class CONT >
typedef type_tools::Copy<obj_type>::const_reference SG::IdentContIndexingPolicy< CONT >::ElementConstReference

Definition at line 49 of file IdentContIndexingPolicy.h.

◆ ElementType

template<class CONT >
typedef type_tools::Copy<obj_type>::type SG::IdentContIndexingPolicy< CONT >::ElementType

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

Definition at line 48 of file IdentContIndexingPolicy.h.

◆ index_type

template<class CONT >
typedef unsigned int SG::IdentContIndexingPolicy< CONT >::index_type

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

Definition at line 53 of file IdentContIndexingPolicy.h.

◆ obj_type

template<class CONT >
typedef coll_type::value_type SG::IdentContIndexingPolicy< CONT >::obj_type
private

Definition at line 43 of file IdentContIndexingPolicy.h.

◆ stored_index_type

template<class CONT >
typedef index_type SG::IdentContIndexingPolicy< CONT >::stored_index_type

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

Definition at line 56 of file IdentContIndexingPolicy.h.

Member Function Documentation

◆ isValid()

template<class CONT >
static bool SG::IdentContIndexingPolicy< CONT >::isValid ( stored_index_type  index)
static

Test to see if an index is valid.

Parameters
indexThe index to test.

◆ lookup()

template<class CONT >
static ElementType SG::IdentContIndexingPolicy< CONT >::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::ExcInvalidIndex if the index is invalid and SG::ExcIndexNotFound if the index is not in the container.

◆ reset()

template<class CONT >
static void SG::IdentContIndexingPolicy< CONT >::reset ( stored_index_type index)
static

Make an index invalid.

Parameters
index[out]The index to reset.

◆ reverseLookup()

template<class CONT >
static void SG::IdentContIndexingPolicy< CONT >::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 >
static index_type SG::IdentContIndexingPolicy< CONT >::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: