28 #ifndef _LOG4CPLUS_HELPERS_POINTERS_HEADER_
29 #define _LOG4CPLUS_HELPERS_POINTERS_HEADER_
31 #include "dcmtk/oflog/config.h"
38 #define INCLUDE_CASSERT
39 #include "dcmtk/ofstd/ofstdinc.h"
51 void addReference()
const;
52 void removeReference()
const;
57 : access_mutex(LOG4CPLUS_MUTEX_CREATE)
62 : access_mutex(LOG4CPLUS_MUTEX_CREATE)
73 LOG4CPLUS_MUTEX_PTR_DECLARE access_mutex;
96 : pointee(rhs.pointee)
105 pointee->removeReference();
109 bool operator==(
const SharedObjectPtr& rhs)
const {
return (pointee == rhs.pointee); }
110 bool operator!=(
const SharedObjectPtr& rhs)
const {
return (pointee != rhs.pointee); }
111 bool operator==(
const T* rhs)
const {
return (pointee == rhs); }
112 bool operator!=(
const T* rhs)
const {
return (pointee != rhs); }
113 T* operator->()
const {assert (pointee);
return pointee; }
114 T& operator*()
const {assert (pointee);
return *pointee; }
118 return this->operator = (rhs.pointee);
128 T*
get()
const {
return pointee; }
133 pointee = other.pointee;
139 operator unspec_bool_type ()
const
141 return pointee ? &SharedObjectPtr::get : 0;
144 bool operator ! ()
const
154 pointee->addReference();
165 #endif // _LOG4CPLUS_HELPERS_POINTERS_HEADER_