1 #ifndef DataFormats_PatCandidates_UserData_h
2 #define DataFormats_PatCandidates_UserData_h
34 virtual const std::type_info &
typeId()
const = 0;
42 template<
typename T>
const T *
get()
const {
43 if (
typeid(
T) !=
typeId())
return 0;
44 return static_cast<const T *
>(
data_());
55 static std::auto_ptr<UserData>
make(
const T &
value,
bool transientOnly=
false) ;
59 virtual const void *
data_ ()
const = 0;
74 virtual const std::type_info &
typeId()
const {
return typeid(
T); }
78 virtual const void *
data_()
const {
return &
obj_; }
100 static const char * demangled = abi::__cxa_demangle(
typeid(
T).
name(), 0, 0, &status);
UserHolder(const T &data)
virtual const void * data_() const =0
Get out the data (can't template non virtual functions)
virtual const std::type_info & typeId() const
Concrete type of stored data.
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 const std::string & typeName() const
Human readable name of the concrete type of stored data.
virtual UserHolder< T > * clone() const
Clone.
virtual const void * data_() const
Get out the data (can't template non virtual functions)
virtual UserData * clone() const =0
Necessary for deep copy in OwnVector.
virtual const std::string & typeName() const =0
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)