CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes
pat::UserHolder< T > Class Template Reference

#include <UserData.h>

Inheritance diagram for pat::UserHolder< T >:
pat::UserData

Public Member Functions

UserHolder< T > * clone () const override
 Clone. More...
 
const std::type_info & typeId () const override
 Concrete type of stored data. More...
 
const std::string & typeName () const override
 Human readable name of the concrete type of stored data. More...
 
 UserHolder ()
 
 UserHolder (const T &data)
 
- Public Member Functions inherited from pat::UserData
const void * bareData () const
 
template<typename T >
const Tget () const
 Extract data in a typesafe way. <T> must be the concrete type of the data. More...
 
 UserData ()
 
virtual ~UserData ()
 

Protected Member Functions

const void * data_ () const override
 Get out the data (can't template non virtual functions) More...
 

Static Private Member Functions

static const std::string & typeName_ ()
 

Private Attributes

T obj_
 

Additional Inherited Members

- Static Public Member Functions inherited from pat::UserData
template<typename T >
std::unique_ptr< pat::UserDatamake (const T &value, bool transientOnly)
 
template<typename T >
static std::unique_ptr< UserDatamake (const T &value, bool transientOnly=false)
 
- Static Protected Member Functions inherited from pat::UserData
static std::string typeNameFor (std::type_info const &iInfo)
 

Detailed Description

template<typename T>
class pat::UserHolder< T >

Definition at line 67 of file UserData.h.

Constructor & Destructor Documentation

◆ UserHolder() [1/2]

template<typename T >
pat::UserHolder< T >::UserHolder ( )
inline

Definition at line 69 of file UserData.h.

69 : obj_() {}

◆ UserHolder() [2/2]

template<typename T >
pat::UserHolder< T >::UserHolder ( const T data)
inline

Definition at line 70 of file UserData.h.

70 : obj_(data) {}

Member Function Documentation

◆ clone()

template<typename T >
UserHolder<T>* pat::UserHolder< T >::clone ( void  ) const
inlineoverridevirtual

Clone.

Implements pat::UserData.

Definition at line 72 of file UserData.h.

72 { return new UserHolder<T>(*this); }

◆ data_()

template<typename T >
const void* pat::UserHolder< T >::data_ ( ) const
inlineoverrideprotectedvirtual

Get out the data (can't template non virtual functions)

Implements pat::UserData.

Definition at line 79 of file UserData.h.

79 { return &obj_; }

References pat::UserHolder< T >::obj_.

◆ typeId()

template<typename T >
const std::type_info& pat::UserHolder< T >::typeId ( ) const
inlineoverridevirtual

Concrete type of stored data.

Implements pat::UserData.

Definition at line 74 of file UserData.h.

74 { return typeid(T); }

◆ typeName()

template<typename T >
const std::string& pat::UserHolder< T >::typeName ( ) const
inlineoverridevirtual

Human readable name of the concrete type of stored data.

Implements pat::UserData.

Definition at line 76 of file UserData.h.

76 { return typeName_(); }

References pat::UserHolder< T >::typeName_().

◆ typeName_()

template<typename T >
const std::string & pat::UserHolder< T >::typeName_ ( )
staticprivate

Definition at line 99 of file UserData.h.

99  {
100  static const std::string name(typeNameFor(typeid(T)));
101  return name;
102 }

References Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by pat::UserHolder< T >::typeName().

Member Data Documentation

◆ obj_

template<typename T >
T pat::UserHolder< T >::obj_
private

Definition at line 82 of file UserData.h.

Referenced by pat::UserHolder< T >::data_().

pat::UserData::typeNameFor
static std::string typeNameFor(std::type_info const &iInfo)
Definition: UserData.cc:28
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
T
long double T
Definition: Basic3DVectorLD.h:48
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
pat::UserHolder::obj_
T obj_
Definition: UserData.h:82
pat::UserHolder::typeName_
static const std::string & typeName_()
Definition: UserData.h:99