williamr@2
|
1 |
/*
|
williamr@2
|
2 |
*
|
williamr@2
|
3 |
* Copyright (c) 1997
|
williamr@2
|
4 |
* Moscow Center for SPARC Technology
|
williamr@2
|
5 |
*
|
williamr@2
|
6 |
* Copyright (c) 1999
|
williamr@2
|
7 |
* Boris Fomitchev
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* This material is provided "as is", with absolutely no warranty expressed
|
williamr@2
|
10 |
* or implied. Any use is at your own risk.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Permission to use or copy this software for any purpose is hereby granted
|
williamr@2
|
13 |
* without fee, provided the above notices are retained on all copies.
|
williamr@2
|
14 |
* Permission to modify the code and to distribute modified code is granted,
|
williamr@2
|
15 |
* provided the above notices are retained, and a notice that the code was
|
williamr@2
|
16 |
* modified is included with the above copyright notice.
|
williamr@2
|
17 |
*
|
williamr@2
|
18 |
*/
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef _STLP_DEBUG_H
|
williamr@2
|
21 |
# define _STLP_DEBUG_H
|
williamr@2
|
22 |
|
williamr@2
|
23 |
# if defined (_STLP_ASSERTIONS) || defined (_STLP_DEBUG)
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef _STLP_CONFIG_H
|
williamr@2
|
26 |
# include <stl/_config.h>
|
williamr@2
|
27 |
#endif
|
williamr@2
|
28 |
|
williamr@2
|
29 |
# if !defined (_STLP_EXTRA_OPERATORS_FOR_DEBUG) && \
|
williamr@2
|
30 |
( defined (_STLP_BASE_MATCH_BUG) || (defined (_STLP_MSVC) && _STLP_MSVC < 1100 ) )
|
williamr@2
|
31 |
# define _STLP_EXTRA_OPERATORS_FOR_DEBUG
|
williamr@2
|
32 |
# endif
|
williamr@2
|
33 |
|
williamr@2
|
34 |
# if !defined(_STLP_FILE__)
|
williamr@2
|
35 |
# define _STLP_FILE__ __FILE__
|
williamr@2
|
36 |
# endif
|
williamr@2
|
37 |
|
williamr@2
|
38 |
enum {
|
williamr@2
|
39 |
_StlFormat_ERROR_RETURN,
|
williamr@2
|
40 |
_StlFormat_ASSERTION_FAILURE,
|
williamr@2
|
41 |
_StlFormat_VERBOSE_ASSERTION_FAILURE,
|
williamr@2
|
42 |
_StlMsg_INVALID_ARGUMENT,
|
williamr@2
|
43 |
_StlMsg_INVALID_CONTAINER,
|
williamr@2
|
44 |
_StlMsg_EMPTY_CONTAINER,
|
williamr@2
|
45 |
_StlMsg_ERASE_PAST_THE_END,
|
williamr@2
|
46 |
_StlMsg_OUT_OF_BOUNDS,
|
williamr@2
|
47 |
_StlMsg_NOT_OWNER,
|
williamr@2
|
48 |
_StlMsg_INVALID_ITERATOR,
|
williamr@2
|
49 |
_StlMsg_INVALID_LEFTHAND_ITERATOR,
|
williamr@2
|
50 |
_StlMsg_INVALID_RIGHTHAND_ITERATOR,
|
williamr@2
|
51 |
_StlMsg_DIFFERENT_OWNERS ,
|
williamr@2
|
52 |
_StlMsg_NOT_DEREFERENCEABLE ,
|
williamr@2
|
53 |
_StlMsg_INVALID_RANGE ,
|
williamr@2
|
54 |
_StlMsg_NOT_IN_RANGE_1 ,
|
williamr@2
|
55 |
_StlMsg_NOT_IN_RANGE_2 ,
|
williamr@2
|
56 |
_StlMsg_INVALID_ADVANCE ,
|
williamr@2
|
57 |
_StlMsg_SINGULAR_ITERATOR ,
|
williamr@2
|
58 |
// debug alloc messages
|
williamr@2
|
59 |
_StlMsg_DBA_DELETED_TWICE ,
|
williamr@2
|
60 |
_StlMsg_DBA_NEVER_ALLOCATED ,
|
williamr@2
|
61 |
_StlMsg_DBA_TYPE_MISMATCH ,
|
williamr@2
|
62 |
_StlMsg_DBA_SIZE_MISMATCH ,
|
williamr@2
|
63 |
_StlMsg_DBA_UNDERRUN ,
|
williamr@2
|
64 |
_StlMsg_DBA_OVERRUN ,
|
williamr@2
|
65 |
// auto_ptr messages
|
williamr@2
|
66 |
_StlMsg_AUTO_PTR_NULL ,
|
williamr@2
|
67 |
_StlMsg_UNKNOWN
|
williamr@2
|
68 |
/* _StlMsg_MAX */
|
williamr@2
|
69 |
};
|
williamr@2
|
70 |
|
williamr@2
|
71 |
/* have to hardcode that ;() */
|
williamr@2
|
72 |
# define _StlMsg_MAX 27
|
williamr@2
|
73 |
|
williamr@2
|
74 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
75 |
|
williamr@2
|
76 |
// This class is unique (not inherited from exception),
|
williamr@2
|
77 |
// to disallow catch in anything but (...)
|
williamr@2
|
78 |
struct __stl_debug_exception {
|
williamr@2
|
79 |
// no members
|
williamr@2
|
80 |
};
|
williamr@2
|
81 |
|
williamr@2
|
82 |
class _STLP_CLASS_DECLSPEC __owned_link;
|
williamr@2
|
83 |
class _STLP_CLASS_DECLSPEC __owned_list;
|
williamr@2
|
84 |
|
williamr@2
|
85 |
template <class _Dummy>
|
williamr@2
|
86 |
struct __stl_debug_engine {
|
williamr@2
|
87 |
|
williamr@2
|
88 |
// Basic routine to report any debug message
|
williamr@2
|
89 |
// Use _STLP_DEBUG_MESSAGE to override
|
williamr@2
|
90 |
static void _STLP_CALL _Message(const char * format_str, ...);
|
williamr@2
|
91 |
|
williamr@2
|
92 |
// Micsellanous function to report indexed error message
|
williamr@2
|
93 |
static void _STLP_CALL _IndexedError(int __ind, const char* __f, int __l);
|
williamr@2
|
94 |
|
williamr@2
|
95 |
// Basic assertion report mechanism.
|
williamr@2
|
96 |
// Reports failed assertion via __stl_debug_message and calls _Terminate
|
williamr@2
|
97 |
// if _STLP_DEBUG_TERMINATE is specified, calls __stl_debug_terminate instead
|
williamr@2
|
98 |
static void _STLP_CALL _Assert(const char* __expr, const char* __f, int __l);
|
williamr@2
|
99 |
|
williamr@2
|
100 |
// The same, with additional diagnostics
|
williamr@2
|
101 |
static void _STLP_CALL _VerboseAssert(const char* __expr, int __error_ind, const char* __f, int __l);
|
williamr@2
|
102 |
|
williamr@2
|
103 |
// If exceptions are present, sends unique exception
|
williamr@2
|
104 |
// If not, calls _STLP_ABORT() to terminate
|
williamr@2
|
105 |
// Use _STLP_DEBUG_TERMINATE to override
|
williamr@2
|
106 |
static void _STLP_CALL _Terminate();
|
williamr@2
|
107 |
|
williamr@2
|
108 |
# ifdef _STLP_DEBUG
|
williamr@2
|
109 |
|
williamr@2
|
110 |
// owned_list/link delegate non-inline functions here
|
williamr@2
|
111 |
|
williamr@2
|
112 |
static bool _STLP_CALL _Check_same_owner( const __owned_link& __i1,
|
williamr@2
|
113 |
const __owned_link& __i2);
|
williamr@2
|
114 |
static bool _STLP_CALL _Check_same_owner_or_null( const __owned_link& __i1,
|
williamr@2
|
115 |
const __owned_link& __i2);
|
williamr@2
|
116 |
static bool _STLP_CALL _Check_if_owner( const __owned_list*, const __owned_link&);
|
williamr@2
|
117 |
|
williamr@2
|
118 |
static void _STLP_CALL _Verify(const __owned_list*);
|
williamr@2
|
119 |
|
williamr@2
|
120 |
static void _STLP_CALL _Swap_owners(__owned_list&, __owned_list& /*, bool __swap_roots */ );
|
williamr@2
|
121 |
|
williamr@2
|
122 |
static void _STLP_CALL _Invalidate_all(__owned_list*);
|
williamr@2
|
123 |
|
williamr@2
|
124 |
static void _STLP_CALL _Stamp_all(__owned_list*, __owned_list*);
|
williamr@2
|
125 |
|
williamr@2
|
126 |
static void _STLP_CALL _M_detach(__owned_list*, __owned_link*);
|
williamr@2
|
127 |
|
williamr@2
|
128 |
static void _STLP_CALL _M_attach(__owned_list*, __owned_link*);
|
williamr@2
|
129 |
|
williamr@2
|
130 |
// accessor : check and get pointer to the container
|
williamr@2
|
131 |
static void* _STLP_CALL _Get_container_ptr(const __owned_link*);
|
williamr@2
|
132 |
# endif /* _STLP_DEBUG */
|
williamr@2
|
133 |
|
williamr@2
|
134 |
// debug messages and formats
|
williamr@2
|
135 |
_STLP_STATIC_MEMBER_DECLSPEC static const char* _Message_table[_StlMsg_MAX];
|
williamr@2
|
136 |
};
|
williamr@2
|
137 |
|
williamr@2
|
138 |
|
williamr@2
|
139 |
# if defined (_STLP_USE_TEMPLATE_EXPORT)
|
williamr@2
|
140 |
_STLP_EXPORT_TEMPLATE struct _STLP_CLASS_DECLSPEC __stl_debug_engine<bool>;
|
williamr@2
|
141 |
# endif /* _STLP_USE_TEMPLATE_EXPORT */
|
williamr@2
|
142 |
|
williamr@2
|
143 |
typedef __stl_debug_engine<bool> __stl_debugger;
|
williamr@2
|
144 |
|
williamr@2
|
145 |
_STLP_END_NAMESPACE
|
williamr@2
|
146 |
|
williamr@2
|
147 |
# ifndef _STLP_ASSERT
|
williamr@2
|
148 |
# define _STLP_ASSERT(expr) \
|
williamr@2
|
149 |
if (!(expr)) {STLPORT::__stl_debugger::_Assert( # expr, _STLP_FILE__, __LINE__);}
|
williamr@2
|
150 |
# endif
|
williamr@2
|
151 |
|
williamr@2
|
152 |
# endif /* _STLP_ASSERTIONS || _STLP_DEBUG */
|
williamr@2
|
153 |
|
williamr@2
|
154 |
|
williamr@2
|
155 |
// this section is for _STLP_DEBUG only
|
williamr@2
|
156 |
#if defined ( _STLP_DEBUG )
|
williamr@2
|
157 |
|
williamr@2
|
158 |
# ifndef _STLP_VERBOSE_ASSERT
|
williamr@2
|
159 |
// fbp : new form not requiring ";"
|
williamr@2
|
160 |
# define _STLP_VERBOSE_ASSERT(expr,__diag_num) \
|
williamr@2
|
161 |
if (!(expr)) { STLPORT::__stl_debugger::_VerboseAssert\
|
williamr@2
|
162 |
( # expr, __diag_num, _STLP_FILE__, __LINE__ ); \
|
williamr@2
|
163 |
}
|
williamr@2
|
164 |
# endif
|
williamr@2
|
165 |
|
williamr@2
|
166 |
# define _STLP_DEBUG_CHECK(expr) _STLP_ASSERT(expr)
|
williamr@2
|
167 |
# define _STLP_DEBUG_DO(expr) expr;
|
williamr@2
|
168 |
|
williamr@2
|
169 |
# ifndef _STLP_VERBOSE_RETURN
|
williamr@2
|
170 |
# define _STLP_VERBOSE_RETURN(__expr,__diag_num) if (!(__expr)) { \
|
williamr@2
|
171 |
__stl_debugger::_IndexedError(__diag_num, __FILE__ , __LINE__); \
|
williamr@2
|
172 |
return false; }
|
williamr@2
|
173 |
# endif
|
williamr@2
|
174 |
|
williamr@2
|
175 |
# ifndef _STLP_VERBOSE_RETURN_0
|
williamr@2
|
176 |
# define _STLP_VERBOSE_RETURN_0(__expr,__diag_num) if (!(__expr)) { \
|
williamr@2
|
177 |
__stl_debugger::_IndexedError(__diag_num, __FILE__ , __LINE__); \
|
williamr@2
|
178 |
return 0; }
|
williamr@2
|
179 |
# endif
|
williamr@2
|
180 |
|
williamr@2
|
181 |
#if ! defined (_STLP_INTERNAL_THREADS_H)
|
williamr@2
|
182 |
# include <stl/_threads.h>
|
williamr@2
|
183 |
#endif
|
williamr@2
|
184 |
|
williamr@2
|
185 |
#ifndef _STLP_INTERNAL_ITERATOR_BASE_H
|
williamr@2
|
186 |
# include <stl/_iterator_base.h>
|
williamr@2
|
187 |
#endif
|
williamr@2
|
188 |
|
williamr@2
|
189 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
190 |
|
williamr@2
|
191 |
//=============================================================
|
williamr@2
|
192 |
template <class _Iterator>
|
williamr@2
|
193 |
inline bool _STLP_CALL __valid_range(const _Iterator& __i1 ,const _Iterator& __i2,
|
williamr@2
|
194 |
const random_access_iterator_tag&) {
|
williamr@2
|
195 |
return (__i1< __i2) || (__i1 == __i2);
|
williamr@2
|
196 |
}
|
williamr@2
|
197 |
|
williamr@2
|
198 |
template <class _Iterator>
|
williamr@2
|
199 |
inline bool _STLP_CALL __valid_range(const _Iterator& __i1 ,const _Iterator& __i2,
|
williamr@2
|
200 |
const bidirectional_iterator_tag&) {
|
williamr@2
|
201 |
// check if comparable
|
williamr@2
|
202 |
bool __dummy(__i1==__i2);
|
williamr@2
|
203 |
return (__dummy==__dummy);
|
williamr@2
|
204 |
}
|
williamr@2
|
205 |
|
williamr@2
|
206 |
template <class _Iterator>
|
williamr@2
|
207 |
inline bool _STLP_CALL __valid_range(const _Iterator& __i1 ,const _Iterator& __i2, const forward_iterator_tag&) {
|
williamr@2
|
208 |
// check if comparable
|
williamr@2
|
209 |
bool __dummy(__i1==__i2);
|
williamr@2
|
210 |
return (__dummy==__dummy);
|
williamr@2
|
211 |
}
|
williamr@2
|
212 |
|
williamr@2
|
213 |
template <class _Iterator>
|
williamr@2
|
214 |
inline bool _STLP_CALL __valid_range(const _Iterator&,const _Iterator&, const input_iterator_tag&) {
|
williamr@2
|
215 |
return true;
|
williamr@2
|
216 |
}
|
williamr@2
|
217 |
|
williamr@2
|
218 |
template <class _Iterator>
|
williamr@2
|
219 |
inline bool _STLP_CALL __valid_range(const _Iterator&,const _Iterator&, const output_iterator_tag&) {
|
williamr@2
|
220 |
return true;
|
williamr@2
|
221 |
}
|
williamr@2
|
222 |
|
williamr@2
|
223 |
template <class _Iterator>
|
williamr@2
|
224 |
inline bool _STLP_CALL __valid_range(const _Iterator& __i1, const _Iterator& __i2) {
|
williamr@2
|
225 |
return __valid_range(__i1,__i2,_STLP_ITERATOR_CATEGORY(__i1, _Iterator));
|
williamr@2
|
226 |
}
|
williamr@2
|
227 |
|
williamr@2
|
228 |
// Note : that means in range [i1, i2].
|
williamr@2
|
229 |
template <class _Iterator>
|
williamr@2
|
230 |
inline bool _STLP_CALL __in_range(const _Iterator& _It, const _Iterator& __i1,
|
williamr@2
|
231 |
const _Iterator& __i2) {
|
williamr@2
|
232 |
return __valid_range(__i1,_It,_STLP_ITERATOR_CATEGORY(__i1, _Iterator)) &&
|
williamr@2
|
233 |
__valid_range(_It,__i2,_STLP_ITERATOR_CATEGORY(_It, _Iterator));
|
williamr@2
|
234 |
}
|
williamr@2
|
235 |
|
williamr@2
|
236 |
template <class _Iterator>
|
williamr@2
|
237 |
inline bool _STLP_CALL __in_range(const _Iterator& __first, const _Iterator& __last,
|
williamr@2
|
238 |
const _Iterator& __start, const _Iterator& __finish) {
|
williamr@2
|
239 |
return __valid_range(__first,__last,_STLP_ITERATOR_CATEGORY(__first, _Iterator)) &&
|
williamr@2
|
240 |
__valid_range(__start,__first,_STLP_ITERATOR_CATEGORY(__first, _Iterator)) &&
|
williamr@2
|
241 |
__valid_range(__last,__finish,_STLP_ITERATOR_CATEGORY(__last, _Iterator));
|
williamr@2
|
242 |
}
|
williamr@2
|
243 |
|
williamr@2
|
244 |
//==========================================================
|
williamr@2
|
245 |
|
williamr@2
|
246 |
|
williamr@2
|
247 |
class _STLP_CLASS_DECLSPEC __owned_link {
|
williamr@2
|
248 |
public:
|
williamr@2
|
249 |
|
williamr@2
|
250 |
__owned_link() : _M_owner(0) {}
|
williamr@2
|
251 |
__owned_link(const __owned_list* __c) : _M_owner(0), _M_next(0) {
|
williamr@2
|
252 |
__stl_debugger::_M_attach(__CONST_CAST(__owned_list*,__c), this);
|
williamr@2
|
253 |
}
|
williamr@2
|
254 |
__owned_link(const __owned_link& __rhs): _M_owner(0) {
|
williamr@2
|
255 |
__stl_debugger::_M_attach(__CONST_CAST(__owned_list*,__rhs._M_owner), this);
|
williamr@2
|
256 |
}
|
williamr@2
|
257 |
__owned_link& operator=(const __owned_link& __rhs) {
|
williamr@2
|
258 |
__owned_list* __new_owner = __CONST_CAST(__owned_list*,__rhs._M_owner);
|
williamr@2
|
259 |
__owned_list* __old_owner = _M_owner;
|
williamr@2
|
260 |
if ( __old_owner != __new_owner ) {
|
williamr@2
|
261 |
__stl_debugger::_M_detach(__old_owner, this);
|
williamr@2
|
262 |
__stl_debugger::_M_attach(__new_owner, this);
|
williamr@2
|
263 |
}
|
williamr@2
|
264 |
return *this;
|
williamr@2
|
265 |
}
|
williamr@2
|
266 |
~__owned_link() {
|
williamr@2
|
267 |
__stl_debugger::_M_detach(_M_owner, this);
|
williamr@2
|
268 |
_Invalidate();
|
williamr@2
|
269 |
}
|
williamr@2
|
270 |
|
williamr@2
|
271 |
const __owned_list* _Owner() const {
|
williamr@2
|
272 |
return _M_owner;
|
williamr@2
|
273 |
}
|
williamr@2
|
274 |
__owned_list* _Owner() {
|
williamr@2
|
275 |
return _M_owner;
|
williamr@2
|
276 |
}
|
williamr@2
|
277 |
void _Set_owner(const __owned_list* __o) {
|
williamr@2
|
278 |
_M_owner= __CONST_CAST(__owned_list*,__o);
|
williamr@2
|
279 |
}
|
williamr@2
|
280 |
bool _Valid() const {
|
williamr@2
|
281 |
return _M_owner !=0;
|
williamr@2
|
282 |
}
|
williamr@2
|
283 |
|
williamr@2
|
284 |
void _Invalidate() { _M_owner=0; _M_next = 0; }
|
williamr@2
|
285 |
void _Link_to_self() { _M_next= 0; }
|
williamr@2
|
286 |
|
williamr@2
|
287 |
__owned_link* _Next() { return _M_next; }
|
williamr@2
|
288 |
const __owned_link* _Next() const { return _M_next; }
|
williamr@2
|
289 |
|
williamr@2
|
290 |
public:
|
williamr@2
|
291 |
__owned_list* _M_owner;
|
williamr@2
|
292 |
__owned_link* _M_next;
|
williamr@2
|
293 |
};
|
williamr@2
|
294 |
|
williamr@2
|
295 |
|
williamr@2
|
296 |
class _STLP_CLASS_DECLSPEC __owned_list {
|
williamr@2
|
297 |
public:
|
williamr@2
|
298 |
__owned_list(const void* __o) {
|
williamr@2
|
299 |
// fprintf(stderr, "__owned_list(): %p\n",(void*)this);
|
williamr@2
|
300 |
_M_node._M_owner = __CONST_CAST(__owned_list*, __REINTERPRET_CAST(const __owned_list*,__o));
|
williamr@2
|
301 |
_M_node._M_next=0;
|
williamr@2
|
302 |
}
|
williamr@2
|
303 |
~__owned_list() {
|
williamr@2
|
304 |
// fprintf(stderr, "~__owned_list(): %p\n",(void*)this);
|
williamr@2
|
305 |
_Invalidate_all();
|
williamr@2
|
306 |
// that prevents detach
|
williamr@2
|
307 |
_M_node._Invalidate();
|
williamr@2
|
308 |
}
|
williamr@2
|
309 |
const void* _Owner() const {
|
williamr@2
|
310 |
return (const void*)_M_node._M_owner;
|
williamr@2
|
311 |
}
|
williamr@2
|
312 |
void* _Owner() {
|
williamr@2
|
313 |
return (void*)_M_node._M_owner;
|
williamr@2
|
314 |
}
|
williamr@2
|
315 |
bool _Valid() const {
|
williamr@2
|
316 |
return _M_node._M_owner!=0;
|
williamr@2
|
317 |
}
|
williamr@2
|
318 |
void _Invalidate() { _M_node._M_owner=0; }
|
williamr@2
|
319 |
|
williamr@2
|
320 |
__owned_link* _First() { return _M_node._Next(); }
|
williamr@2
|
321 |
__owned_link* _Last() { return 0 ; }
|
williamr@2
|
322 |
|
williamr@2
|
323 |
const __owned_link* _First() const { return (__owned_link*)_M_node._M_next; }
|
williamr@2
|
324 |
const __owned_link* _Last() const { return 0 ;}
|
williamr@2
|
325 |
|
williamr@2
|
326 |
void _Verify() const {
|
williamr@2
|
327 |
__stl_debugger::_Verify(this);
|
williamr@2
|
328 |
}
|
williamr@2
|
329 |
|
williamr@2
|
330 |
void _Swap_owners(__owned_list& __y) {
|
williamr@2
|
331 |
__stl_debugger::_Swap_owners(*this, __y);
|
williamr@2
|
332 |
}
|
williamr@2
|
333 |
|
williamr@2
|
334 |
void _Invalidate_all() {
|
williamr@2
|
335 |
__stl_debugger::_Invalidate_all(this);
|
williamr@2
|
336 |
}
|
williamr@2
|
337 |
|
williamr@2
|
338 |
mutable __owned_link _M_node;
|
williamr@2
|
339 |
mutable _STLP_mutex _M_lock;
|
williamr@2
|
340 |
|
williamr@2
|
341 |
private:
|
williamr@2
|
342 |
// should never be called, should be left undefined,
|
williamr@2
|
343 |
// but some compilers complain about it ;(
|
williamr@2
|
344 |
__owned_list(const __owned_list&){}
|
williamr@2
|
345 |
void operator=(const __owned_list&) {}
|
williamr@2
|
346 |
|
williamr@2
|
347 |
friend class __owned_link;
|
williamr@2
|
348 |
friend struct __stl_debug_engine<bool>;
|
williamr@2
|
349 |
};
|
williamr@2
|
350 |
|
williamr@2
|
351 |
|
williamr@2
|
352 |
//==========================================================
|
williamr@2
|
353 |
|
williamr@2
|
354 |
// forward declaratioins
|
williamr@2
|
355 |
|
williamr@2
|
356 |
template <class _Iterator>
|
williamr@2
|
357 |
bool _STLP_CALL __check_range(const _Iterator&, const _Iterator&);
|
williamr@2
|
358 |
template <class _Iterator>
|
williamr@2
|
359 |
bool _STLP_CALL __check_range(const _Iterator&,
|
williamr@2
|
360 |
const _Iterator&, const _Iterator&);
|
williamr@2
|
361 |
template <class _Iterator>
|
williamr@2
|
362 |
bool _STLP_CALL __check_range(const _Iterator&, const _Iterator& ,
|
williamr@2
|
363 |
const _Iterator&, const _Iterator& );
|
williamr@2
|
364 |
|
williamr@2
|
365 |
template <class _Iterator>
|
williamr@2
|
366 |
void _STLP_CALL __invalidate_range(const __owned_list* __base,
|
williamr@2
|
367 |
const _Iterator& __first,
|
williamr@2
|
368 |
const _Iterator& __last);
|
williamr@2
|
369 |
|
williamr@2
|
370 |
template <class _Iterator>
|
williamr@2
|
371 |
void _STLP_CALL __invalidate_iterator(const __owned_list* __base,
|
williamr@2
|
372 |
const _Iterator& __it);
|
williamr@2
|
373 |
|
williamr@2
|
374 |
//============================================================
|
williamr@2
|
375 |
|
williamr@2
|
376 |
inline bool _STLP_CALL
|
williamr@2
|
377 |
__check_same_owner( const __owned_link& __i1, const __owned_link& __i2) {
|
williamr@2
|
378 |
return __stl_debugger::_Check_same_owner(__i1,__i2);
|
williamr@2
|
379 |
}
|
williamr@2
|
380 |
inline bool _STLP_CALL
|
williamr@2
|
381 |
__check_same_owner_or_null( const __owned_link& __i1, const __owned_link& __i2) {
|
williamr@2
|
382 |
return __stl_debugger::_Check_same_owner_or_null(__i1,__i2);
|
williamr@2
|
383 |
}
|
williamr@2
|
384 |
|
williamr@2
|
385 |
template <class _Iterator>
|
williamr@2
|
386 |
inline bool _STLP_CALL __check_if_owner( const __owned_list* __owner,
|
williamr@2
|
387 |
const _Iterator& __it) {
|
williamr@2
|
388 |
return __stl_debugger::_Check_if_owner(__owner, (const __owned_link&)__it);
|
williamr@2
|
389 |
}
|
williamr@2
|
390 |
|
williamr@2
|
391 |
_STLP_END_NAMESPACE
|
williamr@2
|
392 |
|
williamr@2
|
393 |
# endif /* _STLP_DEBUG */
|
williamr@2
|
394 |
|
williamr@2
|
395 |
#if defined ( _STLP_ASSERTIONS )
|
williamr@2
|
396 |
|
williamr@2
|
397 |
# ifndef _STLP_ASSERT_MSG_TRAILER
|
williamr@2
|
398 |
# define _STLP_ASSERT_MSG_TRAILER
|
williamr@2
|
399 |
# endif
|
williamr@2
|
400 |
|
williamr@2
|
401 |
// dwa 12/30/98 - if _STLP_DEBUG_MESSAGE is defined, the user can supply own definition.
|
williamr@2
|
402 |
# if !defined( _STLP_DEBUG_MESSAGE )
|
williamr@2
|
403 |
# define __stl_debug_message __stl_debugger::_Message
|
williamr@2
|
404 |
# else
|
williamr@2
|
405 |
extern void __stl_debug_message(const char * format_str, ...);
|
williamr@2
|
406 |
# endif
|
williamr@2
|
407 |
|
williamr@2
|
408 |
// fbp: if _STLP_DEBUG_TERMINATE is defined, the user can supply own definition.
|
williamr@2
|
409 |
# if !defined( _STLP_DEBUG_TERMINATE )
|
williamr@2
|
410 |
# define __stl_debug_terminate __stl_debugger::_Terminate
|
williamr@2
|
411 |
# else
|
williamr@2
|
412 |
extern void __stl_debug_terminate(void);
|
williamr@2
|
413 |
# endif
|
williamr@2
|
414 |
|
williamr@2
|
415 |
#endif
|
williamr@2
|
416 |
|
williamr@2
|
417 |
# if !defined (_STLP_LINK_TIME_INSTANTIATION)
|
williamr@2
|
418 |
# include <stl/debug/_debug.c>
|
williamr@2
|
419 |
# endif
|
williamr@2
|
420 |
|
williamr@2
|
421 |
#endif /* DEBUG_H */
|
williamr@2
|
422 |
|
williamr@2
|
423 |
// Local Variables:
|
williamr@2
|
424 |
// mode:C++
|
williamr@2
|
425 |
// End:
|
williamr@2
|
426 |
|