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::auto_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_; }
virtual const std::type_info & typeId() const override
Concrete type of stored data.
virtual const void * data_() const override
Get out the data (can't template non virtual functions)
UserHolder(const T &data)
virtual const void * data_() const =0
Get out the data (can't template non virtual functions)
static std::auto_ptr< UserData > make(const T &value, bool transientOnly=false)
virtual const std::type_info & typeId() const =0
Concrete type of stored data.
virtual UserHolder< T > * clone() const override
Clone.
virtual UserData * clone() const =0
Necessary for deep copy in OwnVector.
static std::string typeNameFor(std::type_info const &iInfo)
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.
edm::OwnVector< pat::UserData > UserDataCollection
Base class for data that users can add to pat objects.
static const std::string & typeName_()
const void * bareData() const
static void checkDictionaries(const std::type_info &type)