9 #ifndef _fei_SharedPtr_hpp_
10 #define _fei_SharedPtr_hpp_
12 #include <fei_macros.hpp>
111 #if !defined( FEI_NO_MEMBER_TEMPLATES )
125 ++*(count = x.count);
146 share(x.pointer,x.count);
149 #endif // FEI_NO_MEMBER_TEMPLATES
163 ++*(count = x.count);
182 share(x.pointer, x.count);
204 if ( pointer == p )
return;
242 T*
get()
const {
return pointer; }
258 bool unique()
const {
return *count == 1; }
261 void share(T* xpointer,
long* xcount) {
262 if (count != xcount) {
280 #if defined( FEI_NO_MEMBER_TEMPLATES ) || !defined( FEI_NO_MEMBER_TEMPLATES )
287 #if !defined( FEI_NO_MEMBER_TEMPLATES ) && !defined( FEI_NO_MEMBER_TEMPLATES )
288 template<
typename Y>
friend class SharedPtr;
296 template<
typename T,
typename U>
298 {
return a.
get() == b.
get(); }
303 template<
typename T,
typename U>
305 {
return a.
get() != b.
get(); }
309 #endif // _fei_SharedPtr_hpp_
SharedPtr & operator=(const SharedPtr &x)
SharedPtr(const SharedPtr< Y > &x)
void share(T *xpointer, long *xcount)
SharedPtr(const SharedPtr &x)
bool operator==(const SharedPtr< T > &a, const SharedPtr< U > &b)
SharedPtr & operator=(const SharedPtr< Y > &x)
bool operator!=(const SharedPtr< T > &a, const SharedPtr< U > &b)