BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR > Class Template Reference

#include <bslalg_autoarraydestructor.h>

Public Types

typedef std::ptrdiff_t difference_type
 

Public Member Functions

 AutoArrayDestructor (OBJECT_TYPE *begin, OBJECT_TYPE *end, ALLOCATOR allocator=ALLOCATOR())
 
 ~AutoArrayDestructor ()
 
OBJECT_TYPE * moveBegin (difference_type offset=-1)
 
OBJECT_TYPE * moveEnd (difference_type offset=1)
 
void release ()
 

Detailed Description

template<class OBJECT_TYPE, class ALLOCATOR = bsl::allocator<OBJECT_TYPE>>
class bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR >

This class provides a specialized proctor object that, upon destruction and unless the release method has been called, destroys the elements in a segment of an array of parameterized type OBJECT_TYPE. The elements destroyed are delimited by the "guarded" range [ begin(), end() ).

See bslalg_autoarraydestructor

Member Typedef Documentation

◆ difference_type

template<class OBJECT_TYPE , class ALLOCATOR = bsl::allocator<OBJECT_TYPE>>
typedef std::ptrdiff_t bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR >::difference_type

Constructor & Destructor Documentation

◆ AutoArrayDestructor()

template<class OBJECT_TYPE , class ALLOCATOR >
bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR >::AutoArrayDestructor ( OBJECT_TYPE *  begin,
OBJECT_TYPE *  end,
ALLOCATOR  allocator = ALLOCATOR() 
)
inline

Create an array exception guard object for the sequence of elements of the parameterized OBJECT_TYPE delimited by the range specified by [ begin, end ). The behavior is undefined unless begin <= end and each element in the range [ begin, end ) has been initialized.

◆ ~AutoArrayDestructor()

template<class OBJECT_TYPE , class ALLOCATOR >
bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR >::~AutoArrayDestructor ( )
inline

Call the destructor on each of the elements of the parameterized OBJECT_TYPE delimited by the range [ begin(), end() ) and destroy this array exception guard.

Member Function Documentation

◆ moveBegin()

template<class OBJECT_TYPE , class ALLOCATOR >
OBJECT_TYPE * bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR >::moveBegin ( difference_type  offset = -1)
inline

Move the begin pointer by the specified offset, and return the new begin pointer.

◆ moveEnd()

template<class OBJECT_TYPE , class ALLOCATOR >
OBJECT_TYPE * bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR >::moveEnd ( difference_type  offset = 1)
inline

Move the end pointer by the specified offset, and return the new end pointer.

◆ release()

template<class OBJECT_TYPE , class ALLOCATOR >
void bslalg::AutoArrayDestructor< OBJECT_TYPE, ALLOCATOR >::release ( )
inline

Set the range of elements guarded by this object to be empty. Note that begin() == end() following this operation, but the specific value is unspecified.


The documentation for this class was generated from the following file: