00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef RAUL_SHARED_PTR_HPP
00019 #define RAUL_SHARED_PTR_HPP
00020
00021 #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
00022 #include <algorithm>
00023 #include <cassert>
00024 #include <cstddef>
00025 #include <iostream>
00026 #include <set>
00027
00028 static std::set<void*> shared_ptr_counters;
00029
00030
00031 namespace boost {
00032 inline void sp_scalar_constructor_hook(void* px, std::size_t size, void* pn) {
00033 assert(shared_ptr_counters.find(px) == shared_ptr_counters.end());
00034 shared_ptr_counters.push_back(px);
00035 }
00036
00037 inline void sp_scalar_destructor_hook(void* px, std::size_t size, void* pn) {
00038 shared_ptr_counters.remove(px);
00039 }
00040 }
00041 #endif // BOOST_SP_ENABLE_DEBUG_HOOKS
00042
00043
00044 #include <boost/shared_ptr.hpp>
00045
00046 #ifdef BOOST_AC_USE_PTHREADS
00047 #error "Boost is using mutexes for shared_ptr reference counting."
00048 #error "This is VERY slow. Please report your platform to d@drobilla.net"
00049 #endif
00050
00051 template <typename T> void NullDeleter(T* ptr) {}
00052
00053 #define SharedPtr boost::shared_ptr
00054 #define PtrCast boost::dynamic_pointer_cast
00055
00056 #endif // RAUL_SHARED_PTR_HPP
00057