| 1 |
/* |
| 2 |
* Copyright (c) 1997-1999 |
| 3 |
* Silicon Graphics Computer Systems, Inc. |
| 4 |
* |
| 5 |
* Copyright (c) 1999 |
| 6 |
* Boris Fomitchev |
| 7 |
* |
| 8 |
* This material is provided "as is", with absolutely no warranty expressed |
| 9 |
* or implied. Any use is at your own risk. |
| 10 |
* |
| 11 |
* Permission to use or copy this software for any purpose is hereby granted |
| 12 |
* without fee, provided the above notices are retained on all copies. |
| 13 |
* Permission to modify the code and to distribute modified code is granted, |
| 14 |
* provided the above notices are retained, and a notice that the code was |
| 15 |
* modified is included with the above copyright notice. |
| 16 |
* |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef _STLP_MEMORY |
| 20 |
#define _STLP_MEMORY |
| 21 |
|
| 22 |
#include <type_traits> |
| 23 |
|
| 24 |
#ifndef _STLP_OUTERMOST_HEADER_ID |
| 25 |
# define _STLP_OUTERMOST_HEADER_ID 0x46 |
| 26 |
# include <stl/_prolog.h> |
| 27 |
#endif |
| 28 |
|
| 29 |
#ifndef _STLP_INTERNAL_ALGOBASE_H |
| 30 |
# include <stl/_algobase.h> |
| 31 |
#endif |
| 32 |
|
| 33 |
#ifndef _STLP_INTERNAL_ALLOC_H |
| 34 |
# include <stl/_alloc.h> |
| 35 |
#endif |
| 36 |
|
| 37 |
#ifndef _STLP_INTERNAL_TEMPBUF_H |
| 38 |
# include <stl/_tempbuf.h> |
| 39 |
#endif |
| 40 |
|
| 41 |
#ifndef _STLP_INTERNAL_RAW_STORAGE_ITER_H |
| 42 |
# include <stl/_raw_storage_iter.h> |
| 43 |
#endif |
| 44 |
|
| 45 |
#include <stl/_stdexcept_base.h> |
| 46 |
|
| 47 |
#include <stl/_auto_ptr.h> |
| 48 |
|
| 49 |
#include <stl/_shared_ptr.h> |
| 50 |
|
| 51 |
#if (_STLP_OUTERMOST_HEADER_ID == 0x46) |
| 52 |
# include <stl/_epilog.h> |
| 53 |
# undef _STLP_OUTERMOST_HEADER_ID |
| 54 |
#endif |
| 55 |
|
| 56 |
#if defined(_STLP_USE_BOOST_SUPPORT) |
| 57 |
|
| 58 |
namespace boost { |
| 59 |
|
| 60 |
class bad_weak_ptr; |
| 61 |
template<class T> class shared_ptr; |
| 62 |
template<class T> class weak_ptr; |
| 63 |
template<class T> class enable_shared_from_this; |
| 64 |
template<class D, class T> D * get_deleter(shared_ptr<T> const & p); |
| 65 |
template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r); |
| 66 |
template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r); |
| 67 |
template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r); |
| 68 |
template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b); |
| 69 |
template<class T> void swap(shared_ptr<T> & a, shared_ptr<T> & b); |
| 70 |
|
| 71 |
namespace detail{ |
| 72 |
class shared_count; |
| 73 |
class weak_count; |
| 74 |
} |
| 75 |
|
| 76 |
} // namespace boost |
| 77 |
|
| 78 |
# ifndef BOOST_SHARED_PTR_HPP_INCLUDED |
| 79 |
# include <boost/shared_ptr.hpp> |
| 80 |
# endif |
| 81 |
# ifndef BOOST_WEAK_PTR_HPP_INCLUDED |
| 82 |
# include <boost/weak_ptr.hpp> |
| 83 |
# endif |
| 84 |
# ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED |
| 85 |
# include <boost/enable_shared_from_this.hpp> |
| 86 |
# endif |
| 87 |
|
| 88 |
_STLP_BEGIN_NAMESPACE |
| 89 |
|
| 90 |
namespace tr1 { |
| 91 |
|
| 92 |
using ::boost::bad_weak_ptr; |
| 93 |
using ::boost::shared_ptr; |
| 94 |
using ::boost::swap; |
| 95 |
using ::boost::static_pointer_cast; |
| 96 |
using ::boost::dynamic_pointer_cast; |
| 97 |
using ::boost::const_pointer_cast; |
| 98 |
using ::boost::get_deleter; |
| 99 |
using ::boost::weak_ptr; |
| 100 |
using ::boost::enable_shared_from_this; |
| 101 |
|
| 102 |
// shared_ptr IO |
| 103 |
// weak_ptr IO |
| 104 |
|
| 105 |
} // namespace tr1 |
| 106 |
|
| 107 |
_STLP_END_NAMESPACE |
| 108 |
|
| 109 |
#endif /* !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT */ |
| 110 |
|
| 111 |
#endif /* _STLP_MEMORY */ |
| 112 |
|
| 113 |
// Local Variables: |
| 114 |
// mode:C++ |
| 115 |
// End: |