BDE 4.14.0 Production release
|
#include <bdlma_localbufferedobject.h>
Public Types | |
enum | { k_BUFFER_SIZE = t_BUFFER_SIZE } |
typedef t_TYPE | value_type |
typedef bsl::allocator | allocator_type |
This class
contains an object of type t_TYPE
and a local sequential allocator with an arena size of t_BUFFER_SIZE
, from which the t_TYPE
object allocates memory, in a single object. The t_DISABLE_DESTRUCTION
template parameter can be used to prevent this class
from calling ~t_TYPE()
in cases where it is known that t_TYPE
manages no resources other than memory, since the memory will be adequately managed by the local sequential allocator.
typedef bsl::allocator bdlma::LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION >::allocator_type |
typedef t_TYPE bdlma::LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION >::value_type |
anonymous enum |
|
inlineexplicit |
Create a value_type
object using the specified args
that will allocate memory from a sequential allocator based on a local stack buffer of (template parameter) t_BUFFER_SIZE
size; if local stack memory is exhausted, use the default allocator to supply additional heap memory.
bdlma::LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION >::LocalBufferedObject | ( | bsl::allocator_arg_t | , |
allocator_type | allocator, | ||
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... | args | ||
) |
Create a value_type
object using the specified args
that will allocate memory from a sequential allocator based on a local stack buffer of (template parameter) t_BUFFER_SIZE
size; if local stack memory is exhausted, use the specified allocator
to supply additional heap memory.
|
inline |
Destroy this object and free any memory it uses, and if the (template parameter) t_DISABLE_DESTRUCTION
is true
, do this without calling the destructor of value_type
(see t_DISABLE_DESTRUCTION
template parameter in the component doc).
|
inline |
bdlma::LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION >::BSLMF_NESTED_TRAIT_DECLARATION | ( | LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION > | , |
BloombergLP::bslmf::UsesAllocatorArgT | |||
) |
void bdlma::LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION >::emplace | ( | BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... | args | ) |
Destroy the value_type
object unless t_DISABLE_DESTRUCTION
is true, then release all allocated memory, the re-construct a new value_type
object using the specified args
and using the sequential allocator based on the local stack buffer.
|
inline |
Return the alloctor passed at construction, used to provide heap memory after the local stack buffer is exhausted. Note that this is not the arena allocator contained in this object.
|
inline |
Return a reference providing modifiable access to the underlying t_TYPE
object.
|
inline |
Return a reference providing const access to the underlying t_TYPE
object.
|
inline |
Return a pointer providing modifiable access to the underlying t_TYPE
object.
|
inline |
Return a pointer providing const access to the underlying t_TYPE
object.
bsl::enable_if< BDLMA_LOCAL_BUFFERED_VALUE_IS_ASSIGNABLE(t_TYPE, BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE)), LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION > >::type & bdlma::LocalBufferedObject< t_TYPE, t_BUFFER_SIZE, t_DISABLE_DESTRUCTION >::operator= | ( | BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) | value | ) |