ACE_Allocator
.
More...
#include <DurabilityArray.h>
Public Member Functions | |
DurabilityArray (size_t size, ACE_Allocator *allocator) | |
DurabilityArray (size_t size, T const &default_value, ACE_Allocator *allocator) | |
DurabilityArray (DurabilityArray< T > const &rhs) | |
~DurabilityArray () | |
void | operator= (DurabilityArray< T > const &rhs) |
void | set_allocator (ACE_Allocator *allocator) |
Reset allocator. | |
void | swap (DurabilityArray< T > &rhs) |
ACE_Allocator
.
This class only exists to provide a means to reset the allocator used by the ACE_Array_Base
base class. It has a specific use case, namely to correctly support instances created by a persistent allocator. The allocator address may change between process runs, meaning the allocator address stored in the persistent ACE_Array_Base
instance will be invalid. Use the set_allocator()
method to reset the allocator address before performing any operations that will require use of the allocator (e.g. increasing the size of the array).
Definition at line 36 of file DurabilityArray.h.
OpenDDS::DCPS::DurabilityArray< T >::DurabilityArray | ( | size_t | size, | |
ACE_Allocator * | allocator | |||
) | [inline] |
OpenDDS::DCPS::DurabilityArray< T >::DurabilityArray | ( | size_t | size, | |
T const & | default_value, | |||
ACE_Allocator * | allocator | |||
) | [inline] |
OpenDDS::DCPS::DurabilityArray< T >::DurabilityArray | ( | DurabilityArray< T > const & | rhs | ) | [inline] |
Definition at line 50 of file DurabilityArray.h.
00051 : ACE_Array_Base<T> (rhs.size(), rhs.allocator_) 00052 { 00053 for (size_t i = 0; i < this->size_; ++i) 00054 this->array_[i] = rhs.array_[i]; 00055 }
OpenDDS::DCPS::DurabilityArray< T >::~DurabilityArray | ( | ) | [inline] |
void OpenDDS::DCPS::DurabilityArray< T >::operator= | ( | DurabilityArray< T > const & | rhs | ) | [inline] |
Definition at line 60 of file DurabilityArray.h.
References OpenDDS::DCPS::DurabilityArray< T >::swap().
00061 { 00062 DurabilityArray tmp(rhs); 00063 this->swap(rhs); 00064 }
void OpenDDS::DCPS::DurabilityArray< T >::set_allocator | ( | ACE_Allocator * | allocator | ) | [inline] |
Reset allocator.
Definition at line 67 of file DurabilityArray.h.
References allocator_.
00068 { 00069 if (allocator == 0) 00070 allocator = ACE_Allocator::instance(); 00071 00072 this->allocator_ = allocator; 00073 }
void OpenDDS::DCPS::DurabilityArray< T >::swap | ( | DurabilityArray< T > & | rhs | ) | [inline] |
Definition at line 75 of file DurabilityArray.h.
References OpenDDS::DCPS::swap().
Referenced by OpenDDS::DCPS::DurabilityArray< T >::operator=().
00076 { 00077 std::swap(this->max_size_, rhs.max_size_); 00078 std::swap(this->cur_size_, rhs.current_size_); 00079 std::swap(this->array_, rhs.array_); 00080 std::swap(this->allocator_, rhs.allocator_); 00081 }