9 #ifndef ThePEG_PtrTraits_H
10 #define ThePEG_PtrTraits_H
66 static pointer
create() {
return new T; }
71 static pointer
create(const_reference t) {
return new T(t); }
76 static void destroy(pointer tp) {
delete tp; }
82 static pointer
DynamicCast(R * r) {
return dynamic_cast<pointer
>(r); }
87 static pointer
ConstCast(
const T * t) {
return const_cast<pointer
>(t); }
92 static pointer
PtrCast(T * t) {
return t; }
97 static const bool reference_counted =
false;
127 static pointer
create() {
return new T; }
132 static pointer
create(const_reference t) {
return new T(t); }
137 static void destroy(pointer tp) {
delete tp; }
144 return dynamic_cast<const_pointer
>(r);
150 static const_pointer
ConstCast(
const T * r) {
return r; }
155 static const_pointer
PtrCast(
const T * t) {
return t; }
160 static const bool reference_counted =
false;
167 template <
class T1,
class T2>
174 template <
class T1,
class T2>
180 template <
typename Ptr>
186 template <
typename Ptr>
194 template <
typename T>
202 template <
typename T>
210 template <
typename TPtr,
typename T>
218 template <
typename TPtr,
typename T>
Ptr< T >::pointer new_ptr()
Simple interface to the PtrTraits
::create()
static const_pointer PtrCast(const T *t)
Cast from a basic pointer.
The PtrTraits class is used everywhere in ThePEG to interface to the pointers which are handled...
static const T * barePointer(const T *p)
Return the bare pointer of the given pointer object.
static pointer create()
Create an object and return a pointer to it.
T & reference
Template argument typedef.
static pointer ConstCast(const T *t)
Cast away constness.
static pointer PtrCast(T *t)
Cast from a basic pointer.
T & reference
Template argument typedef.
static pointer create()
Create an object and return a pointer to it.
T * const_pointer
Template argument typedef.
static T * barePointer(T *p)
Return the bare pointer of the given pointer object.
T value_type
Template argument typedef.
T1 dynamic_ptr_cast(const T2 &t2)
Replacement for the standard dynamic_cast.
static void destroy(pointer tp)
Destroy the object pointed to.
This is the main namespace within which all identifiers in ThePEG are declared.
TPtr ptr_cast_const(const T *t)
Simple interface to the PtrTraits
::PtrCast()
static const_pointer ConstCast(const T *r)
Do not cast away constness.
const T & const_reference
Template argument typedef.
TPtr ptr_cast(T *t)
Simple interface to the PtrTraits
::PtrCast()
T1 const_ptr_cast(const T2 &t2)
Replacement for the standard const_cast.
RCPtr is a reference counted (smart) pointer.
T * const_pointer
Template argument typedef.
static pointer DynamicCast(R *r)
Cast dynamically.
PtrTraitsType is an empty non-polymorphic base class for all PtrTraits classes.
T * pointer
Template argument typedef.
T value_type
Template argument typedef.
Ptr is a templated class to provide typedefs for pointers types ThePEG should use for a given type...
T * pointer
Template argument typedef.
Ptr ptr_new()
Simple interface to the PtrTraits
::create()
static pointer create(const_reference t)
Create an copy of an object and return a pointer to it.
static const_pointer DynamicCast(const R *r)
Cast dynamically.
static pointer create(const_reference t)
Create an copy of an object and return a pointer to it.
static void destroy(pointer tp)
Destroy the object pointed to.
const T & const_reference
Template argument typedef.