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 69 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 79 of file SafetyProfileSequence.h.

00079 : 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 80 of file SafetyProfileSequence.h.

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

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

Definition at line 344 of file SafetyProfileSequence.h.

References ACE_Allocator::instance(), and ACE_Allocator::malloc().

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

Here is the call graph for this function:

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

Definition at line 72 of file SafetyProfileSequence.h.

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

00072 { return Unbounded::Bounds; }

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

Definition at line 71 of file SafetyProfileSequence.h.

00071 { 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 73 of file SafetyProfileSequence.h.

References release().

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

Here is the call graph for this function:

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

Definition at line 84 of file SafetyProfileSequence.h.

References OpenDDS::DCPS::swap().

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

Here is the call graph for this function:


Member Data Documentation

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

Definition at line 85 of file SafetyProfileSequence.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1