OpenDDS  Snapshot(2023/04/28-20:55)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded > Struct Template Reference

#include <SafetyProfileSequence.h>

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

◆ AllocPolicy()

template<typename T , typename Sequence >
OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::AllocPolicy ( seq_size_type  n = 0)
inlineexplicitprotected

Member Function Documentation

◆ allocate()

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

Definition at line 80 of file SafetyProfileSequence.h.

◆ allocbuf()

template<typename T , typename Sequence >
T * OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::allocbuf ( seq_size_type  n)
inlinestatic

Definition at line 342 of file SafetyProfileSequence.h.

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

343  {
344  const size_t bytes = (n + Sequence::ElementPolicy::extra) * sizeof(T);
345  void* const raw = ACE_Allocator::instance()->malloc(bytes);
346  T* const mem = static_cast<T*>(raw);
347  Sequence::ElementPolicy::construct(mem, n, true);
348  return mem + Sequence::ElementPolicy::extra;
349  }
static ACE_Allocator * instance(void)
virtual void * malloc(size_type nbytes)=0

◆ max_size()

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

Definition at line 72 of file SafetyProfileSequence.h.

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

72 { return Unbounded::Bounds; }
static const seq_size_type Bounds

◆ maximum()

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

◆ replace()

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(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::replace_i().

75  {
76  static_cast<Sequence&>(*this).replace_i(maximum, length, data, release);
77  }

◆ swap()

template<typename T , typename Sequence >
void OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Unbounded >::swap ( AllocPolicy< T, Sequence, Unbounded > &  rhs)
throw (
)
inlineprotected

Definition at line 84 of file SafetyProfileSequence.h.

References OpenDDS::DCPS::swap().

84 { std::swap(maximum_, rhs.maximum_); }
void swap(MessageBlock &lhs, MessageBlock &rhs)

Member Data Documentation

◆ maximum_

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: