ATLAS Offline Software
Loading...
Searching...
No Matches
DataModel_detail::DVLInfoBase Class Referenceabstract

#include <DVLInfo.h>

Inheritance diagram for DataModel_detail::DVLInfoBase:
Collaboration diagram for DataModel_detail::DVLInfoBase:

Public Member Functions

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

Static Public Member Functions

static DVLInfoBasefind (const std::type_info &tinfo)
 Find the DVLInfo for the container tinfo.
static DVLInfoBasefind (CLID clid)
 Find the DVLInfo for the container clid.

Private Attributes

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

Detailed Description

Definition at line 67 of file DVLInfo.h.

Constructor & Destructor Documentation

◆ DVLInfoBase()

DataModel_detail::DVLInfoBase::DVLInfoBase ( const std::type_info & tinfo,
const std::type_info & elt_tinfo )

Constructor.

Parameters
tinfoType info object for the container being described.
elt_tinfoType info object for the element type of the container being described (with pointer and const's stripped.)

Note: these objects should only be allocated statically.

Definition at line 59 of file DVLInfo.cxx.

61 : m_tinfo (tinfo),
63{
64 lock_guard<mutex> lock (s_dvl_tinfo_mutex);
65 if (s_dvl_tinfo_map == 0)
66 s_dvl_tinfo_map = new dvl_tinfo_map_t;
67 (*s_dvl_tinfo_map)[&tinfo] = this;
68}
const std::type_info & elt_tinfo() const
Return the type_info for the container's element.
const std::type_info & m_elt_tinfo
The type_info of the container's element.
Definition DVLInfo.h:185
const std::type_info & tinfo() const
Return the type_info for the container.
const std::type_info & m_tinfo
The type_info of the container.
Definition DVLInfo.h:182
mutex s_dvl_tinfo_mutex
Definition DVLInfo.cxx:42
std::unordered_map< const std::type_info *, DVLInfoBase * > dvl_tinfo_map_t
Maps from tinfo pointers and CLID to DVLInfo instances.
Definition DVLInfo.cxx:40

◆ ~DVLInfoBase()

virtual DataModel_detail::DVLInfoBase::~DVLInfoBase ( )
inlinevirtual

Destructor.

Definition at line 83 of file DVLInfo.h.

83{}

Member Function Documentation

◆ base()

virtual SG::AuxVectorBase * DataModel_detail::DVLInfoBase::base ( void * cont_p) const
pure virtual

Return a pointer to the container base.

Parameters
cont_pPointer to the container.

Implemented in DataModel_detail::DVLInfo< T >.

◆ clear()

virtual void DataModel_detail::DVLInfoBase::clear ( void * cont_p) const
pure virtual

Erase the elements in the container.

Parameters
cont_pPointer to the container.

Implemented in DataModel_detail::DVLInfo< T >.

◆ clid()

CLID DataModel_detail::DVLInfoBase::clid ( ) const

Return the CLID for the container.

Definition at line 117 of file DVLInfo.cxx.

118{
120}
static CLID typeinfoToCLID(const std::type_info &ti)
Return the CLID corresponding to a type_info.

◆ clone()

virtual void * DataModel_detail::DVLInfoBase::clone ( void * cont_p) const
pure virtual

Copy a container.

Parameters
cont_pPointer to the container.

Implemented in DataModel_detail::DVLInfo< T >.

◆ del()

virtual void DataModel_detail::DVLInfoBase::del ( void * cont_p) const
pure virtual

Delete a container.

Parameters
cont_pPointer to the container.

Implemented in DataModel_detail::DVLInfo< T >.

◆ elt_tinfo()

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

Return the type_info for the container's element.

(Pointer and const stripped.)

◆ find() [1/2]

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

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}
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
static DVLInfoBase * find(const std::type_info &tinfo)
Find the DVLInfo for the container tinfo.
Definition DVLInfo.cxx:76
CLID clid() const
Return the CLID for the container.
Definition DVLInfo.cxx:117

◆ find() [2/2]

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

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}

◆ iterator()

virtual DVLIteratorBase * DataModel_detail::DVLInfoBase::iterator ( const void * cont_p) const
pure virtual

Return a new iterator object.

Parameters
cont_pPointer to the container.

Implemented in DataModel_detail::DVLInfo< T >.

◆ make()

virtual void * DataModel_detail::DVLInfoBase::make ( size_t nreserve) const
pure virtual

Construct a new container.

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

Implemented in DataModel_detail::DVLInfo< T >.

◆ push()

virtual void DataModel_detail::DVLInfoBase::push ( void * cont_p,
void * elt_p ) const
pure 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.)

Implemented in DataModel_detail::DVLInfo< T >.

◆ size()

virtual size_t DataModel_detail::DVLInfoBase::size ( void * cont_p) const
pure virtual

Return the size of the container.

Parameters
cont_pPointer to the container.

Implemented in DataModel_detail::DVLInfo< T >.

◆ tinfo()

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

Return the type_info for the container.

Member Data Documentation

◆ m_elt_tinfo

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

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
private

The type_info of the container.

Definition at line 182 of file DVLInfo.h.


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