5 #ifndef CVMFS_UTIL_POINTER_H_
6 #define CVMFS_UTIL_POINTER_H_
12 #ifdef CVMFS_NAMESPACE_GUARD
13 namespace CVMFS_NAMESPACE_GUARD {
22 static const bool value =
false;
30 template<
class T,
class DerivedT>
44 return *(
static_cast<DerivedT *
>(
this));
47 inline bool IsValid()
const {
return (ref_ != NULL); }
59 void Free() {
static_cast<DerivedT *
>(
this)->
Free(); }
72 using BaseT::operator=;
75 inline T &
operator*()
const {
return *BaseT::ref_; }
78 void Free() {
delete BaseT::ref_; }
89 using BaseT::operator=;
103 :
public UniquePtrBase<unsigned char, UniquePtr<unsigned char> > {
109 using BaseT::operator=;
122 #ifdef CVMFS_NAMESPACE_GUARD
126 #endif // CVMFS_UTIL_POINTER_H_
DerivedT & operator=(T *ref)
UniquePtr(unsigned char *ref)
UniquePtrBase< T, UniquePtr< T > > BaseT
UniquePtrBase< void, UniquePtr< void > > BaseT
UniquePtrBase< unsigned char, UniquePtr< unsigned char > > BaseT