BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslma_autorawdeleter.h
Go to the documentation of this file.
1/// @file bslma_autorawdeleter.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslma_autorawdeleter.h -*-C++-*-
8#ifndef INCLUDED_BSLMA_AUTORAWDELETER
9#define INCLUDED_BSLMA_AUTORAWDELETER
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslma_autorawdeleter bslma_autorawdeleter
15/// @brief Provide a range proctor to manage a sequence objects.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslma
19/// @{
20/// @addtogroup bslma_autorawdeleter
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslma_autorawdeleter-purpose"> Purpose</a>
25/// * <a href="#bslma_autorawdeleter-classes"> Classes </a>
26/// * <a href="#bslma_autorawdeleter-description"> Description </a>
27/// * <a href="#bslma_autorawdeleter-raw-warning"> "Raw" Warning </a>
28/// * <a href="#bslma_autorawdeleter-requirement"> Requirement </a>
29/// * <a href="#bslma_autorawdeleter-usage"> Usage </a>
30///
31/// # Purpose {#bslma_autorawdeleter-purpose}
32/// Provide a range proctor to manage a sequence objects.
33///
34/// # Classes {#bslma_autorawdeleter-classes}
35///
36/// - bslma::AutoRawDeleter: range proctor to manage a sequence of objects
37///
38/// @see bslma_rawdeleterproctor, bslma_rawdeleterguard
39///
40/// # Description {#bslma_autorawdeleter-description}
41/// This component provides a range proctor class template,
42/// `bslma::AutoRawDeleter`, to manage a sequence of (otherwise-unmanaged)
43/// objects of parameterized `TYPE` supplied at construction. If not explicitly
44/// released, the sequence of managed objects are deleted automatically when the
45/// range proctor goes out of scope by iterating over each object, first calling
46/// the (managed) object's destructor, and then freeing its memory footprint by
47/// invoking the `deallocate` method of an allocator (or pool) of parameterized
48/// `ALLOCATOR` type also supplied at construction. Note that after a range
49/// proctor releases its sequence of managed objects, the same proctor can be
50/// reused to conditionally manage another sequence of objects (allocated from
51/// the same allocator or pool that was supplied at construction) by invoking
52/// the `reset` method.
53///
54/// ## "Raw" Warning {#bslma_autorawdeleter-raw-warning}
55///
56///
57/// Note that this component should be used only if we are sure that the
58/// supplied pointer is **not** of a type that is a secondary base class -- i.e.,
59/// the (managed) object's address is (numerically) the same as when it was
60/// originally dispensed by `ALLOCATOR`.
61///
62/// ## Requirement {#bslma_autorawdeleter-requirement}
63///
64///
65/// The parameterized `ALLOCATOR` type of the `bslma::AutoRawDeleter` class
66/// template must provide a (possibly `virtual`) method:
67/// @code
68/// void deallocate(void *address);
69/// @endcode
70/// to deallocate memory at the specified `address` (originally supplied by the
71/// `ALLOCATOR` object).
72///
73/// ## Usage {#bslma_autorawdeleter-usage}
74///
75///
76/// The `bslma::AutoRawDeleter` proctor object can be used to preserve exception
77/// neutrality during manipulation of out-of-place arrays of user-defined-type
78/// objects. The following illustrates the insertion operation for an
79/// "out-of-place" string array. Assume that a string array initially contains
80/// the addresses of the following string objects as its elements:
81/// @code
82/// 0 1 2 3 4
83/// _____ _____ _____ _____ _____
84/// | o | o | o | o | o |
85/// `==|==^==|==^==|==^==|==^==|=='
86/// _V_ _V_ _V_ _V_ _V_
87/// |"A"| |"B"| |"C"| |"D"| |"E"|
88/// `===' `===' `===' `===' `==='
89/// @endcode
90/// To insert two string objects with values "F" and "G" at index position 2,
91/// the array is first reallocated if it is not big enough, and then the
92/// existing elements at index positions 2, 3, and 4 are shifted:
93/// @code
94/// 0 1 2 3 4 5 6
95/// _____ _____ _____ _____ _____ _____ _____
96/// | o | o |xxxxx|xxxxx| o | o | o |
97/// `==|==^==|==^=====^=====^==|==^==|==^==|=='
98/// _V_ _V_ _V_ _V_ _V_
99/// |"A"| |"B"| |"C"| |"D"| |"E"|
100/// `===' `===' `===' `===' `==='
101///
102/// Note: "xxxxx" denotes undefined value
103/// @endcode
104/// Next, two new string objects must be created and initialized with string
105/// values "F" and "G", respectively. If, during creation, an allocation fails
106/// and an exception is thrown, the array will be left in an invalid state
107/// because the addresses contained at index positions 2 and 3 may be duplicates
108/// of those at index positions 4 and 5, or, if a resize occurred, invalid
109/// altogether. We can restore exception neutrality by setting the array's
110/// length to 2 before attempting to create the string objects, but there is
111/// still a problem: the string objects "C", "D", and "E" (at index positions
112/// 3, 4, and 5) are "orphaned" and will never be deleted -- a memory leak. To
113/// prevent this potential memory leak, we can additionally create a
114/// `bslma::AutoRawDeleter` object to manage (temporarily) the elements at index
115/// positions 4, 5, and 6 prior to creating the new objects:
116/// @code
117/// 0 1 2 3 4 5 6
118/// _____ _____ _____ _____ _____ _____ _____
119/// | o | o |xxxxx|xxxxx| o | o | o |
120/// `==|==^==|==^=====^=====^==|==^==|==^==|=='
121/// _V_ _V_ _V_ _V_ _V_
122/// |"A"| |"B"| |"C"| |"D"| |"E"|
123/// `===' `===' `===' `===' `==='
124/// my_StrArray2 ^-----------------bslma::AutoRawDeleter
125/// (length = 2) (length = 3)
126///
127/// Figure: Use of proctor for my_StrArray2::insert
128/// @endcode
129/// If an exception occurs, the array (now of length 2) is in a perfectly valid
130/// state, while the second proctor is responsible for deleting the orphaned
131/// elements at index positions 4, 5, and 6. If no exception is thrown, the
132/// elements at index positions 2 and 3 are set to new strings "F" and "G", the
133/// length of the first proctor is set to 7 and the second proctor's `release`
134/// method is called, releasing its control over the temporarily managed
135/// elements.
136///
137/// The following example illustrates the use of `bslma::AutoRawDeleter` in
138/// conjunction with `bslma::DeallocatorProctor` to manage temporarily a
139/// templatized, "out-of-place" array of parameterized `TYPE` objects during the
140/// array's insertion operation.
141///
142/// First we define a `myArray` class that stores an array of parameterized
143/// `TYPE` objects:
144/// @code
145/// /// This class is a container that stores an array of objects of
146/// /// parameterized `TYPE`.
147/// template <class TYPE>
148/// class myArray {
149///
150/// // DATA
151/// TYPE **d_array_p; // dynamically allocated array of
152/// // character sequence
153///
154/// int d_length; // logical length of this array
155///
156/// int d_size; // physical capacity of this array
157///
158/// bslma::Allocator *d_allocator_p; // allocator (held, not owned)
159///
160/// public:
161/// // CREATORS
162///
163/// /// Create a `myArray` object. Optionally specify a
164/// /// `basicAllocator` used to supply memory. If `basicAllocator` is
165/// /// 0, the currently installed default allocator is used.
166/// myArray(bslma::Allocator *basicAllocator = 0);
167///
168/// /// Destroy this `myArray` object and all elements currently stored.
169/// ~myArray();
170///
171/// // MANIPULATORS
172///
173/// /// Insert into this array at the specified `dstIndex`, the
174/// /// character sequences in the specified `srcArray`. All values
175/// /// with initial indices at or above `dstIndex` are shifted up by
176/// /// `srcArray.length()` index positions. The behavior is undefined
177/// /// unless `0 <= dstIndex` and `dstIndex <= length()`.
178/// void insert(int dstIndex, const myArray& srcArray);
179///
180/// // ...
181///
182/// // ACCESSORS
183///
184/// /// Return the logical length of this array.
185/// int length() const;
186///
187/// // ...
188/// };
189/// @endcode
190/// Note that a `bslma::DeallocatorProctor` is used to manage a block of memory
191/// allocated before invoking the constructor of `TYPE`. If the constructor of
192/// `TYPE` throws, the (managed) memory is automatically deallocated by
193/// `bslma::DeallocatorProctor`s destructor:
194/// @code
195/// template <class TYPE>
196/// void myArray<TYPE>::insert(int dstIndex, const myArray<TYPE>& srcArray)
197/// {
198/// int srcLength = srcArray.d_length;
199/// int newLength = d_length + srcLength;
200/// int numShifted = d_length - dstIndex;
201///
202/// if (newLength > d_size) { // need to resize
203/// // ...
204/// }
205///
206/// // First shift the elements to the back of the array.
207/// memmove(d_array_p + dstIndex + srcLength,
208/// d_array_p + dstIndex,
209/// numShifted * sizeof *d_array_p);
210///
211/// // Shorten 'd_length' and use 'bslma::AutoDeleter' to proctor tail
212/// // elements.
213/// d_length = dstIndex;
214///
215/// //*************************************************************
216/// // Note the use of auto raw deleter on tail elements (below). *
217/// //*************************************************************
218///
219/// bslma::AutoRawDeleter<TYPE, bslma::Allocator>
220/// tailDeleter(d_array_p + dstIndex + srcLength,
221/// d_allocator_p,
222/// numShifted);
223/// @endcode
224/// Now, if any allocation, either allocating memory for new elements or the
225/// constructor of the new element throws, the elements that had been moved to
226/// the end of the array will be deleted automatically by the
227/// `bslma::AutoRawDeleter`.
228/// @code
229/// // Used to temporarily proctor each new element's memory.
230/// bslma::DeallocatorProctor<bslma::Allocator>
231/// elementDeallocator(0, d_allocator_p);
232///
233/// if (this != &srcArray) { // no self-alias
234///
235/// // Copy the objects one by one.
236/// for (int i = 0; i < srcLength; ++i, ++d_length) {
237/// d_array_p[dstIndex + i] =
238/// (TYPE *) d_allocator_p->allocate(sizeof **d_array_p);
239///
240/// elementDeallocator.reset(d_array_p[dstIndex + i]);
241/// new(d_array_p[dstIndex + i]) TYPE(*srcArray.d_array_p[i],
242/// d_allocator_p);
243/// elementDeallocator.release();
244/// }
245/// }
246/// else { // self-alias
247/// // ...
248/// }
249///
250/// //*********************************************
251/// // Note that the proctor is released (below). *
252/// //*********************************************
253///
254/// tailDeleter.release();
255/// d_length = newLength;
256/// }
257/// @endcode
258/// Note that portions of the implementation are elided as it adds unnecessary
259/// complications to the usage example. The shown portion is sufficient to
260/// illustrate the use of @ref bslma_autorawdeleter .
261///
262/// The above method copies the source elements (visually) from left to right.
263/// Another (functionally equivalent) implementation copies the source elements
264/// from right to left, and makes use of the `operator--()` of the
265/// `bslma::AutoRawDeleter` interface:
266/// @code
267/// template <class TYPE>
268/// void myArray<TYPE>::insert(int dstIndex, const myStrArray<TYPE>& srcArray)
269/// {
270/// int srcLength = srcArray.d_length;
271/// int newLength = d_length + srcLength;
272/// int numShifted = d_length - dstIndex;
273///
274/// if (newLength > d_size) { // need to resize
275/// // ...
276/// }
277///
278/// // First shift the elements to the back of the array.
279/// memmove(d_array_p + dstIndex + srcLength,
280/// d_array_p + dstIndex,
281/// numShifted * sizeof *d_array_p);
282///
283/// // Shorten 'd_length' and use 'bslma::AutoDeallocator' to proctor the
284/// // memory shifted.
285/// d_length = dst_Index;
286///
287/// //********************************************
288/// //* Note the use of auto raw deleter on tail *
289/// //* memory with negative length (below). *
290/// //********************************************
291///
292/// bslma::AutoRawDeleter<TYPE, bslma::Allocator> tailDeleter(newLength,
293/// d_allocator_p,
294/// -numShifted);
295/// @endcode
296/// Since we have decided to copy the source elements from right to left, we
297/// set the origin of the `bslma::AutoRawDeleter` to the end of the array, and
298/// decrement the (signed) length on each copy to extend the proctor range by
299/// 1.
300/// @code
301/// // Used to temporarily proctor each new element's memory.
302/// bslma::DeallocatorProctor<bslma::Allocator>
303/// elementDeallocator(0, d_allocator_p);
304///
305/// if (this != &srcArray) { // no self-alias
306///
307/// // Copy the character sequences from the 'srcArray'. Note that the
308/// // 'tailDeleter' has to be decremented to cover the newly
309/// // created object.
310///
311/// for (int i = srcLength - 1; i >= 0; --i, --tailDeleter) {
312/// d_array_p[dstIndex + i] =
313/// (TYPE *) d_allocator_p->allocate(sizeof **d_array_p);
314/// elementDeallocator.reset(d_array_p[dstIndex + i]);
315/// new(d_array_p[dstIndex + i]) TYPE(*srcArray.d_array_p[i],
316/// d_allocator_p);
317/// elementDeallocator.release();
318/// }
319/// }
320/// else { // self-alias
321/// // ...
322/// }
323///
324/// //*********************************************
325/// // Note that the proctor is released (below). *
326/// //*********************************************
327///
328/// tailDeleter.release();
329/// d_length = newLength;
330/// }
331/// @endcode
332/// Note that though the two implementations are functionally equivalent, they
333/// are logically different. First of all, the second implementation will be
334/// slightly slower because it is accessing memory backwards when compared to
335/// the normal forward sequential access. Secondly, in case of an exception,
336/// the first implementation will retain all the elements copied prior to the
337/// exception, whereas the second implementation will remove them.
338/// @}
339/** @} */
340/** @} */
341
342/** @addtogroup bsl
343 * @{
344 */
345/** @addtogroup bslma
346 * @{
347 */
348/** @addtogroup bslma_autorawdeleter
349 * @{
350 */
351
352#include <bslscm_version.h>
353
354#include <bslma_deleterhelper.h>
355
356#include <bsls_assert.h>
357#include <bsls_performancehint.h>
358
359
360
361namespace bslma {
362
363 // ====================
364 // class AutoRawDeleter
365 // ====================
366
367/// This class implements a range proctor that, unless its `release` method
368/// has previously been invoked, automatically deletes the contiguous
369/// sequence of managed objects upon destruction by iterating on each
370/// (managed) object, first invoking the object's destructor, and then free
371/// memory by invoking the `deallocate` method of an allocator (or pool) of
372/// parameterized `ALLOCATOR` type supplied to it at construction. The
373/// sequence of managed objects of parameterized `TYPE` must have been
374/// created using memory provided by this allocator (or pool), which must
375/// remain valid throughout the lifetime of this range proctor.
376///
377/// \note Note that when the length of this object is non-zero, it must refer to a non-null
378/// array of objects.
379///
380/// See @ref bslma_autorawdeleter
381template <class TYPE, class ALLOCATOR>
383
384 // DATA
385 TYPE **d_origin_p; // reference location for the sequence of
386 // managed objects
387
388 int d_length; // number of objects managed (sign encodes
389 // direction)
390
391 ALLOCATOR *d_allocator_p; // allocator or pool (held, not owned)
392
393 private:
394 // NOT IMPLEMENTED
396 AutoRawDeleter& operator=(const AutoRawDeleter&);
397
398 private:
399 // PRIVATE MANIPULATORS
400
401 /// Delete the contiguous sequence of objects managed by this auto raw
402 /// deleter (if any) by iterating over each (managed) object, first
403 /// invoking the object's destructor, and then freeing memory by
404 /// invoking the `deallocate` method of the allocator (or pool) that was
405 /// supplied with the sequence of (managed) objects at construction.
406 ///
407 /// \note Note that the order in which the managed objects are deleted is
408 /// undefined. Also note that this method factors out the destruction
409 /// logic, which allows the destructor to be declared `inline` for the
410 /// common case (the range proctor released before being destroyed).
411 void rawDelete();
412
413 public:
414 // CREATORS
415
416 /// Create an auto raw deleter to manage an array of objects at the
417 /// specified `origin`, and that uses the specified `allocator` to
418 /// delete the sequence of objects managed by this range proctor (if not
419 /// released -- see `release`) upon destruction. Optionally specify
420 /// `length` to define its range, which by default is empty (i.e.,
421 /// `length = 0`). The sequence of objects may extend in either
422 /// direction from `origin`. A positive `length` represents the
423 /// sequence of objects starting at `origin` and extending "up" to
424 /// `length` (*not* including the object at the index position
425 /// `origin + length`). A negative `length` represents the sequence of
426 /// objects starting at one position below `origin` and extending "down"
427 /// to the absolute value of `length` (including the object at index
428 /// position `origin + length`). If `length` is 0, then this range
429 /// proctor manages no objects. If `origin` is non-zero, all objects
430 /// within the proctored range (if any) must be constructed using memory supplied by `allocator`.
431 ///
432 /// \pre The behavior is undefined unless
433 /// `allocator` is non-zero, and, if `origin` is 0, 'length is also 0.
434 ///
435 /// \note Note that when `length` is non-positive, the object at the origin is
436 /// *not* managed by this range proctor. For example, if `origin` is at
437 /// the index position 2, a `length` of 2 signifies that the objects at
438 /// positions 2 and 3 are managed, whereas a `length` of -2 signifies
439 /// that the objects at positions 0 and 1 are managed:
440 /// @code
441 /// length = -2 length = 2
442 /// |<----->| |<----->|
443 /// ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
444 /// | 0 | 1 | 2 | 3 | 4 | | 0 | 1 | 2 | 3 | 4 |
445 /// `===^===^===^===^===' `===^===^===^===^==='
446 /// ^------------ origin ^------------ origin
447 /// @endcode
448 AutoRawDeleter(TYPE **origin,
449 ALLOCATOR *allocator,
450 int length = 0);
451
452 /// Destroy this range proctor and delete the contiguous sequence of
453 /// objects it manages (if any) by iterating over each (managed) object,
454 /// first invoking the object's destructor, and then freeing memory by
455 /// invoking the `deallocate` method of the allocator (or pool) that was
456 /// supplied with the sequence of (managed) objects at construction.
457 ///
458 /// \note Note that the order in which the managed objects are deleted is
459 /// undefined.
461
462 // MANIPULATORS
463
464 /// Increase by one the (signed) length of the sequence of objects managed by this range proctor.
465 ///
466 /// \pre The behavior is undefined unless the
467 /// origin of the sequence of objects managed by this proctor is non-zero.
468 ///
469 /// \pre The behavior is undefined unless the origin or this range proctor is non-zero.
470 ///
471 /// \note Note that if the length of this proctor is
472 /// currently negative, the number of managed objects will decrease by
473 /// one, whereas if the length is non-negative, the number of managed
474 /// objects will increase by one.
475 void operator++();
476
477 /// Decrease by one the (signed) length of the sequence of objects managed by this range proctor.
478 ///
479 /// \pre The behavior is undefined unless the
480 /// origin of the sequence of objects managed by this proctor is non-zero.
481 ///
482 /// \pre The behavior is undefined unless the origin or this range proctor is non-zero.
483 ///
484 /// \note Note that if the length of this proctor is
485 /// currently positive, the number of managed objects will decrease by
486 /// one, whereas if the length is non-positive, the number of managed
487 /// objects will increase by one.
488 void operator--();
489
490 /// Release from management the sequence of objects currently managed by
491 /// this range proctor by setting the length of the managed sequence to
492 /// 0. All objects currently under management will become unmanaged
493 /// (i.e., when the proctor goes out of scope and it was not assigned
494 /// another sequence of objects to manage by invoking `reset`, no
495 /// objects will be deleted). If no objects are currently being managed, this method has no effect.
496 ///
497 /// \note Note that the origin is not
498 /// affected.
499 void release() ;
500
501 /// Set the specified `origin` as the origin of the sequence of objects
502 /// to be managed by this range proctor.
503 ///
504 /// \pre The behavior is undefined unless `origin` is non-zero.
505 /// \note Note that the length of the sequence
506 /// of objects managed by this proctor is not affected, and `setLength`
507 /// should be invoked if the managed range is different from the
508 /// previously managed sequence of objects. Also note that this method
509 /// releases any previously-managed objects from management (without
510 /// deleting them), and so may be called with or without having called
511 /// `release` when reusing this object.
512 void reset(TYPE **origin);
513
514 /// Set the (signed) length of the sequence of objects managed by this
515 /// range proctor to the specified `length`.
516 ///
517 /// \pre The behavior is undefined unless the origin of this range proctor is non-zero.
518 void setLength(int length);
519
520 // ACCESSORS
521
522 /// Return the (signed) length of the sequence of objects managed by
523 /// this range proctor.
524 int length() const;
525};
526
527// ============================================================================
528// INLINE DEFINITIONS
529// ============================================================================
530
531 // --------------------
532 // class AutoRawDeleter
533 // --------------------
534
535// PRIVATE MANIPULATORS
536template <class TYPE, class ALLOCATOR>
538{
539 if (d_length > 0) {
540 for (; d_length > 0; --d_length, ++d_origin_p) {
542 d_allocator_p);
543 }
544 }
545 else {
546 --d_origin_p;
547 for (; d_length < 0; ++d_length, --d_origin_p) {
549 d_allocator_p);
550 }
551 }
552}
553
554// CREATORS
555template <class TYPE, class ALLOCATOR>
556inline
558AutoRawDeleter(TYPE **origin, ALLOCATOR *allocator, int length)
559: d_origin_p(origin)
560, d_length(length)
561, d_allocator_p(allocator)
562{
563 BSLS_ASSERT_SAFE(allocator);
564 BSLS_ASSERT_SAFE(origin || !length);
565}
566
567template <class TYPE, class ALLOCATOR>
568inline
570{
571 BSLS_ASSERT_SAFE(d_origin_p || !d_length);
572
574 rawDelete();
575 }
576}
577
578// MANIPULATORS
579template <class TYPE, class ALLOCATOR>
580inline
582{
583 BSLS_ASSERT_SAFE(d_origin_p);
584
585 ++d_length;
586}
587
588template <class TYPE, class ALLOCATOR>
589inline
591{
592 BSLS_ASSERT_SAFE(d_origin_p);
593
594 --d_length;
595}
596
597template <class TYPE, class ALLOCATOR>
598inline
600{
601 d_length = 0;
602}
603
604template <class TYPE, class ALLOCATOR>
605inline
607{
608 BSLS_ASSERT_SAFE(origin);
609
610 d_origin_p = origin;
611}
612
613template <class TYPE, class ALLOCATOR>
614inline
616{
617 BSLS_ASSERT_SAFE(d_origin_p);
618
619 d_length = length;
620}
621
622// ACCESSORS
623template <class TYPE, class ALLOCATOR>
624inline
626{
627 return d_length;
628}
629
630} // close package namespace
631
632#ifndef BDE_OPENSOURCE_PUBLICATION // BACKWARD_COMPATIBILITY
633// ============================================================================
634// BACKWARD COMPATIBILITY
635// ============================================================================
636
637#ifdef bslma_AutoRawDeleter
638#undef bslma_AutoRawDeleter
639#endif
640/// This alias is defined for backward compatibility.
641#define bslma_AutoRawDeleter bslma::AutoRawDeleter
642#endif // BDE_OPENSOURCE_PUBLICATION -- BACKWARD_COMPATIBILITY
643
644
645
646#endif
647
648// ----------------------------------------------------------------------------
649// Copyright 2013 Bloomberg Finance L.P.
650//
651// Licensed under the Apache License, Version 2.0 (the "License");
652// you may not use this file except in compliance with the License.
653// You may obtain a copy of the License at
654//
655// http://www.apache.org/licenses/LICENSE-2.0
656//
657// Unless required by applicable law or agreed to in writing, software
658// distributed under the License is distributed on an "AS IS" BASIS,
659// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
660// See the License for the specific language governing permissions and
661// limitations under the License.
662// ----------------------------- END-OF-FILE ----------------------------------
663
664/** @} */
665/** @} */
666/** @} */
Definition bslma_autorawdeleter.h:382
void operator++()
Definition bslma_autorawdeleter.h:581
~AutoRawDeleter()
Definition bslma_autorawdeleter.h:569
void reset(TYPE **origin)
Definition bslma_autorawdeleter.h:606
int length() const
Definition bslma_autorawdeleter.h:625
void setLength(int length)
Definition bslma_autorawdeleter.h:615
void release()
Definition bslma_autorawdeleter.h:599
void operator--()
Definition bslma_autorawdeleter.h:590
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY(expr)
Definition bsls_performancehint.h:452
Definition baljsn_encoder_testtypes.h:76
static void deleteObjectRaw(const TYPE *object, ALLOCATOR *allocator)
Definition bslma_deleterhelper.h:225