ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
DataModel_detail::DVLInfo< T > Class Template Reference

#include <DVLInfo.h>

Inheritance diagram for DataModel_detail::DVLInfo< T >:
Collaboration diagram for DataModel_detail::DVLInfo< T >:

Public Types

typedef T Container
 Container type. More...
 
typedef std::remove_const< typename Container::base_value_type >::type Elt
 The container's element type (with pointer and any const removed). More...
 

Public Member Functions

 DVLInfo ()
 Constructor. More...
 
virtual void * make (size_t nreserve) const
 Construct a new container. More...
 
virtual void push (void *cont_p, void *elt_p) const
 Push a new pointer into the container. More...
 
virtual size_t size (void *cont_p) const
 Return the size of the container. More...
 
virtual void clear (void *cont_p) const
 Erase the elements in the container. More...
 
virtual void del (void *cont_p) const
 Delete a container. More...
 
virtual void * clone (void *cont_p) const
 Copy a container. More...
 
virtual DVLIteratorBaseiterator (const void *cont_p) const
 Return a new iterator object. More...
 
virtual SG::AuxVectorBasebase (void *cont_p) const
 Return a pointer to the container base. More...
 
const std::type_info & tinfo () const
 Return the type_info for the container. More...
 
CLID clid () const
 Return the CLID for the container. More...
 
const std::type_info & elt_tinfo () const
 Return the type_info for the container's element. More...
 

Static Public Member Functions

static const std::type_info * initHelper ()
 Helper to create the DVLInfo static instance. More...
 
static DVLInfoBasefind (const std::type_info &tinfo)
 Find the DVLInfo for the container tinfo. More...
 
static DVLInfoBasefind (CLID clid)
 Find the DVLInfo for the container clid. More...
 

Private Attributes

const std::type_info & m_tinfo
 The type_info of the container. More...
 
const std::type_info & m_elt_tinfo
 The type_info of the container's element. More...
 

Detailed Description

template<class T>
class DataModel_detail::DVLInfo< T >

Definition at line 235 of file DVLInfo.h.

Member Typedef Documentation

◆ Container

template<class T >
typedef T DataModel_detail::DVLInfo< T >::Container

Container type.

Definition at line 240 of file DVLInfo.h.

◆ Elt

template<class T >
typedef std::remove_const<typename Container::base_value_type>::type DataModel_detail::DVLInfo< T >::Elt

The container's element type (with pointer and any const removed).

Definition at line 243 of file DVLInfo.h.

Constructor & Destructor Documentation

◆ DVLInfo()

template<class T >
DataModel_detail::DVLInfo< T >::DVLInfo ( )

Constructor.

Note: these objects should only be allocated statically.

Member Function Documentation

◆ base()

template<class T >
virtual SG::AuxVectorBase* DataModel_detail::DVLInfo< T >::base ( void *  cont_p) const
virtual

Return a pointer to the container base.

Parameters
cont_pPointer to the container.

Implements DataModel_detail::DVLInfoBase.

◆ clear()

template<class T >
virtual void DataModel_detail::DVLInfo< T >::clear ( void *  cont_p) const
virtual

Erase the elements in the container.

Parameters
cont_pPointer to the container.

Implements DataModel_detail::DVLInfoBase.

◆ clid()

CLID DataModel_detail::DVLInfoBase::clid ( ) const
inherited

Return the CLID for the container.

Definition at line 117 of file DVLInfo.cxx.

118 {
120 }

◆ clone()

template<class T >
virtual void* DataModel_detail::DVLInfo< T >::clone ( void *  cont_p) const
virtual

Copy a container.

Parameters
cont_pPointer to the container.

Implements DataModel_detail::DVLInfoBase.

◆ del()

template<class T >
virtual void DataModel_detail::DVLInfo< T >::del ( void *  cont_p) const
virtual

Delete a container.

Parameters
cont_pPointer to the container.

Implements DataModel_detail::DVLInfoBase.

◆ elt_tinfo()

const std::type_info& DataModel_detail::DVLInfoBase::elt_tinfo ( ) const
inherited

Return the type_info for the container's element.

(Pointer and const stripped.)

◆ find() [1/2]

DVLInfoBase * DataModel_detail::DVLInfoBase::find ( CLID  clid)
staticinherited

Find the DVLInfo for the container clid.

Find the DVLInfo for the container tinfo.

Parameters
clidCLID of the desired container.
Returns
Pointer to the DVLInfo, or 0 if not found.
Parameters
clidCLID of the desired container.
tinfotype_info of the desired container.
Returns
Pointer to the DVLInfo, or 0 if not found.

Definition at line 105 of file DVLInfo.cxx.

106 {
107  const std::type_info* ti = CLIDRegistry::CLIDToTypeinfo (clid);
108  if (ti)
109  return DVLInfoBase::find (*ti);
110  return 0;
111 }

◆ find() [2/2]

DVLInfoBase * DataModel_detail::DVLInfoBase::find ( const std::type_info &  tinfo)
staticinherited

Find the DVLInfo for the container tinfo.

Parameters
tinfotype_info of the desired container.
Returns
Pointer to the DVLInfo, or 0 if not found.

Definition at line 76 of file DVLInfo.cxx.

77 {
78  lock_guard<mutex> lock (s_dvl_tinfo_mutex);
79  if (!s_dvl_tinfo_map)
80  return 0;
81  dvl_tinfo_map_t::iterator i = s_dvl_tinfo_map->find (&tinfo);
82  if (i != s_dvl_tinfo_map->end())
83  return i->second;
84  return 0;
85 }

◆ initHelper()

template<class T >
static const std::type_info* DataModel_detail::DVLInfo< T >::initHelper ( )
static

Helper to create the DVLInfo static instance.

Calling this will create the DVLInfo static instance. This can be called from, for example, an initializer for a class static variable.

◆ iterator()

template<class T >
virtual DVLIteratorBase* DataModel_detail::DVLInfo< T >::iterator ( const void *  cont_p) const
virtual

Return a new iterator object.

Parameters
cont_pPointer to the container.

Implements DataModel_detail::DVLInfoBase.

◆ make()

template<class T >
virtual void* DataModel_detail::DVLInfo< T >::make ( size_t  nreserve) const
virtual

Construct a new container.

Parameters
nreserveNumber of elements for which to reserve space. (Ignored if not appropriate.)

Implements DataModel_detail::DVLInfoBase.

◆ push()

template<class T >
virtual void DataModel_detail::DVLInfo< T >::push ( void *  cont_p,
void *  elt_p 
) const
virtual

Push a new pointer into the container.

Parameters
cont_pPointer to the container.
elt_pPointer to the element to push. (Must match the container's declared element type.)

Implements DataModel_detail::DVLInfoBase.

◆ size()

template<class T >
virtual size_t DataModel_detail::DVLInfo< T >::size ( void *  cont_p) const
virtual

Return the size of the container.

Parameters
cont_pPointer to the container.

Implements DataModel_detail::DVLInfoBase.

◆ tinfo()

const std::type_info& DataModel_detail::DVLInfoBase::tinfo ( ) const
inherited

Return the type_info for the container.

Member Data Documentation

◆ m_elt_tinfo

const std::type_info& DataModel_detail::DVLInfoBase::m_elt_tinfo
privateinherited

The type_info of the container's element.

Definition at line 185 of file DVLInfo.h.

◆ m_tinfo

const std::type_info& DataModel_detail::DVLInfoBase::m_tinfo
privateinherited

The type_info of the container.

Definition at line 182 of file DVLInfo.h.


The documentation for this class was generated from the following file:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
DataModel_detail::DVLInfoBase::tinfo
const std::type_info & tinfo() const
Return the type_info for the container.
CLIDRegistry::typeinfoToCLID
static CLID typeinfoToCLID(const std::type_info &ti)
Return the CLID corresponding to a type_info.
Definition: CLIDRegistry.cxx:148
CLIDRegistry::CLIDToTypeinfo
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
Definition: CLIDRegistry.cxx:136
DataModel_detail::DVLInfoBase::clid
CLID clid() const
Return the CLID for the container.
Definition: DVLInfo.cxx:117
DataModel_detail::DVLInfoBase::m_tinfo
const std::type_info & m_tinfo
The type_info of the container.
Definition: DVLInfo.h:182
lumiFormat.i
int i
Definition: lumiFormat.py:92
DataModel_detail::s_dvl_tinfo_mutex
mutex s_dvl_tinfo_mutex
Definition: DVLInfo.cxx:42
DataModel_detail::DVLInfoBase::find
static DVLInfoBase * find(const std::type_info &tinfo)
Find the DVLInfo for the container tinfo.
Definition: DVLInfo.cxx:76