ATLAS Offline Software
Public Types | Static Public Member Functions | List of all members
SG::AuxDataTraits< T, ALLOC > Class Template Reference

Allow customizing how aux data types are treated. More...

#include <AuxDataTraits.h>

Collaboration diagram for SG::AuxDataTraits< T, ALLOC >:

Public Types

using element_type = T
 The type the user sees. More...
 
using reference_type = element_type &
 Reference types returned by aux data accessors. More...
 
using const_reference_type = const element_type &
 
using allocator_type = ALLOC
 Allocator type used to store this variable. More...
 
using vector_type = std::vector< T, allocator_type >
 Container type used to store this variable. More...
 
using container_value_type = typename vector_type::value_type
 
using container_pointer_type = typename vector_type::pointer
 Pointers to the data within the container. More...
 
using const_container_pointer_type = typename vector_type::const_pointer
 
using span = CxxUtils::span< container_value_type >
 
using const_span = CxxUtils::span< const container_value_type >
 

Static Public Member Functions

static reference_type index (void *ptr, size_t ndx)
 Look up an element in the container by index. More...
 
static const_reference_type index (const void *ptr, size_t ndx)
 Look up an element in the container by index. More...
 

Detailed Description

template<class T, class ALLOC = AuxAllocator_t<T>>
class SG::AuxDataTraits< T, ALLOC >

Allow customizing how aux data types are treated.

T here is the type that the user requests, eg in the template argument of a decorator.

Definition at line 39 of file AuxDataTraits.h.

Member Typedef Documentation

◆ allocator_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::allocator_type = ALLOC

Allocator type used to store this variable.

Definition at line 50 of file AuxDataTraits.h.

◆ const_container_pointer_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::const_container_pointer_type = typename vector_type::const_pointer

Definition at line 58 of file AuxDataTraits.h.

◆ const_reference_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::const_reference_type = const element_type&

Definition at line 47 of file AuxDataTraits.h.

◆ const_span

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::const_span = CxxUtils::span<const container_value_type>

Definition at line 75 of file AuxDataTraits.h.

◆ container_pointer_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::container_pointer_type = typename vector_type::pointer

Pointers to the data within the container.

Definition at line 57 of file AuxDataTraits.h.

◆ container_value_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::container_value_type = typename vector_type::value_type

Definition at line 54 of file AuxDataTraits.h.

◆ element_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::element_type = T

The type the user sees.

Definition at line 43 of file AuxDataTraits.h.

◆ reference_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::reference_type = element_type&

Reference types returned by aux data accessors.

Definition at line 46 of file AuxDataTraits.h.

◆ span

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::span = CxxUtils::span<container_value_type>

Definition at line 74 of file AuxDataTraits.h.

◆ vector_type

template<class T , class ALLOC = AuxAllocator_t<T>>
using SG::AuxDataTraits< T, ALLOC >::vector_type = std::vector<T, allocator_type>

Container type used to store this variable.

Definition at line 53 of file AuxDataTraits.h.

Member Function Documentation

◆ index() [1/2]

template<class T , class ALLOC = AuxAllocator_t<T>>
static const_reference_type SG::AuxDataTraits< T, ALLOC >::index ( const void *  ptr,
size_t  ndx 
)
inlinestatic

Look up an element in the container by index.

ptr is a pointer to the start of the container's data.

Definition at line 69 of file AuxDataTraits.h.

70  {
71  return reinterpret_cast<const_container_pointer_type>(ptr)[ndx];
72  }

◆ index() [2/2]

template<class T , class ALLOC = AuxAllocator_t<T>>
static reference_type SG::AuxDataTraits< T, ALLOC >::index ( void *  ptr,
size_t  ndx 
)
inlinestatic

Look up an element in the container by index.

ptr is a pointer to the start of the container's data.

Definition at line 62 of file AuxDataTraits.h.

63  {
64  return reinterpret_cast<container_pointer_type>(ptr)[ndx];
65  }

The documentation for this class was generated from the following file:
SG::AuxDataTraits::container_pointer_type
typename vector_type::pointer container_pointer_type
Pointers to the data within the container.
Definition: AuxDataTraits.h:57
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
SG::AuxDataTraits::const_container_pointer_type
typename vector_type::const_pointer const_container_pointer_type
Definition: AuxDataTraits.h:58