13 #ifndef STXXL_COMMON_EXTERNAL_SHARED_PTR_HEADER
14 #define STXXL_COMMON_EXTERNAL_SHARED_PTR_HEADER
86 P* p =
reinterpret_cast<P*
>((
void*)data);
95 P* p =
reinterpret_cast<P*
>((
void*)data);
101 P* p1 =
reinterpret_cast<P*
>((
void*)data);
102 P* p2 =
reinterpret_cast<P*
>((
void*)x.
data);
111 return os << p.
get();
119 #endif // !STXXL_COMMON_EXTERNAL_SHARED_PTR_HEADER
P get() const
If this is called after unwrap() the behaviour is undefined.
friend std::ostream & operator<<(std::ostream &os, const uint_pair &a)
make a uint_pair outputtable via iostreams, using unsigned long long.
external_shared_ptr()
This constructor needs to be defined so that the [] operator in maps and hash tables works...
external_shared_ptr(P ptr)
Copy the pointer to internal storage and increment the refcount (the destructor never gets called)...
#define STXXL_BEGIN_NAMESPACE
This class takes a shared pointer, increments its reference count and wraps it in a way that the resu...
char data[sizeof(P)]
We store the pointer like this so that the refcount does not get incremented when the wrapper is copy...
bool operator==(const uint_pair &b) const
equality checking operator
void unwrap()
Call the destructor to decrement the refcount.
#define STXXL_END_NAMESPACE