1 #ifndef DataFormats_PatCandidates_UserData_h 2 #define DataFormats_PatCandidates_UserData_h 33 virtual const std::type_info &
typeId()
const = 0;
41 template<
typename T>
const T *
get()
const {
42 if (
typeid(
T) !=
typeId())
return 0;
43 return static_cast<const T *
>(
data_());
54 static std::unique_ptr<UserData>
make(
const T &
value,
bool transientOnly=
false) ;
58 virtual const void *
data_ ()
const = 0;
74 virtual const std::type_info &
typeId()
const override {
return typeid(
T); }
78 virtual const void *
data_()
const override {
return &obj_; }
UserHolder(const T &data)
static std::unique_ptr< UserData > make(const T &value, bool transientOnly=false)
virtual const std::type_info & typeId() const override
Concrete type of stored data.
virtual const std::type_info & typeId() const =0
Concrete type of stored data.
virtual const void * data_() const =0
Get out the data (can't template non virtual functions)
virtual const std::string & typeName() const =0
Human readable name of the concrete type of stored data.
virtual const std::string & typeName() const override
Human readable name of the concrete type of stored data.
virtual const void * data_() const override
Get out the data (can't template non virtual functions)
virtual UserData * clone() const =0
Necessary for deep copy in OwnVector.
static std::string typeNameFor(std::type_info const &iInfo)
char data[epos_bytes_allocation]
edm::OwnVector< pat::UserData > UserDataCollection
Base class for data that users can add to pat objects.
static const std::string & typeName_()
virtual UserHolder< T > * clone() const override
Clone.
const void * bareData() const
static void checkDictionaries(const std::type_info &type)