OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded > Struct Template Reference

#include <SafetyProfileSequence.h>

List of all members.

Public Member Functions

seq_size_type maximum () const
seq_size_type max_size () const
void replace (seq_size_type maximum, seq_size_type length, T *data, seq_flag_type release=false)

Static Public Member Functions

static T * allocbuf (seq_size_type n)

Protected Member Functions

 AllocPolicy (seq_size_type n=0)
T * allocate (seq_size_type request=0) const
void swap (AllocPolicy &rhs) throw ()

Protected Attributes

seq_size_type maximum_


Detailed Description

template<typename T, typename Sequence>
struct OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >

Definition at line 68 of file SafetyProfileSequence.h.


Constructor & Destructor Documentation

template<typename T, typename Sequence>
OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::AllocPolicy ( seq_size_type  n = 0  )  [inline, explicit, protected]

Definition at line 78 of file SafetyProfileSequence.h.

00078 : maximum_(n) {}


Member Function Documentation

template<typename T, typename Sequence>
T* OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::allocate ( seq_size_type  request = 0  )  const [inline, protected]

Definition at line 79 of file SafetyProfileSequence.h.

00080     {
00081       return allocbuf(request ? request : maximum_);
00082     }

template<typename T, typename Sequence>
T * OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::allocbuf ( seq_size_type  n  )  [inline, static]

Definition at line 343 of file SafetyProfileSequence.h.

00344   {
00345     const size_t bytes = (n + Sequence::ElementPolicy::extra) * sizeof(T);
00346     void* const raw = ACE_Allocator::instance()->malloc(bytes);
00347     T* const mem = static_cast<T*>(raw);
00348     Sequence::ElementPolicy::construct(mem, n, true);
00349     return mem + Sequence::ElementPolicy::extra;
00350   }

template<typename T, typename Sequence>
seq_size_type OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::max_size (  )  const [inline]

Definition at line 71 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::Unbounded::Bounds.

00071 { return Unbounded::Bounds; }

template<typename T, typename Sequence>
seq_size_type OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::maximum (  )  const [inline]

Definition at line 70 of file SafetyProfileSequence.h.

00070 { return maximum_; }

template<typename T, typename Sequence>
void OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::replace ( seq_size_type  maximum,
seq_size_type  length,
T *  data,
seq_flag_type  release = false 
) [inline]

Definition at line 72 of file SafetyProfileSequence.h.

00074     {
00075       static_cast<Sequence&>(*this).replace_i(maximum, length, data, release);
00076     }

template<typename T, typename Sequence>
void OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::swap ( AllocPolicy< T, Sequence, Unbounded > &  rhs  )  throw () [inline, protected]

Definition at line 83 of file SafetyProfileSequence.h.

References OpenDDS::DCPS::swap().

00083 { std::swap(maximum_, rhs.maximum_); }


Member Data Documentation

template<typename T, typename Sequence>
seq_size_type OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::maximum_ [protected]

Definition at line 84 of file SafetyProfileSequence.h.


The documentation for this struct was generated from the following file:
Generated on Fri Feb 12 20:06:51 2016 for OpenDDS by  doxygen 1.4.7