OpenDDS  Snapshot(2023/04/28-20:55)
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Bounded< N > > 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 length, T *data, seq_flag_type release=false)
 

Static Public Member Functions

static T * allocbuf ()
 

Protected Member Functions

 AllocPolicy (seq_size_type=N)
 
T * allocate (seq_size_type=N) const
 
void swap (AllocPolicy &) throw ()
 

Detailed Description

template<typename T, typename Sequence, seq_size_type N>
struct OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Bounded< N > >

Definition at line 54 of file SafetyProfileSequence.h.

Constructor & Destructor Documentation

◆ AllocPolicy()

template<typename T , typename Sequence , seq_size_type N>
OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Bounded< N > >::AllocPolicy ( seq_size_type  = N)
inlineexplicitprotected

Definition at line 63 of file SafetyProfileSequence.h.

63 {}

Member Function Documentation

◆ allocate()

template<typename T , typename Sequence , seq_size_type N>
T* OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Bounded< N > >::allocate ( seq_size_type  = N) const
inlineprotected

◆ allocbuf()

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

Definition at line 332 of file SafetyProfileSequence.h.

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

333  {
334  void* const raw =
335  ACE_Allocator::instance()->malloc(N * sizeof(T));
336  T* const mem = static_cast<T*>(raw);
337  Sequence::ElementPolicy::construct(mem, N, false);
338  return mem;
339  }
static ACE_Allocator * instance(void)
virtual void * malloc(size_type nbytes)=0

◆ max_size()

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

Definition at line 57 of file SafetyProfileSequence.h.

57 { return N; }

◆ maximum()

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

Definition at line 56 of file SafetyProfileSequence.h.

56 { return N; }

◆ replace()

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

Definition at line 58 of file SafetyProfileSequence.h.

References release(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::replace_i().

59  {
60  static_cast<Sequence&>(*this).replace_i(N, length, data, release);
61  }

◆ swap()

template<typename T , typename Sequence , seq_size_type N>
void OpenDDS::SafetyProfile::AllocPolicy< T, Sequence, Bounded< N > >::swap ( AllocPolicy< T, Sequence, Bounded< N > > &  )
throw (
)
inlineprotected

Definition at line 65 of file SafetyProfileSequence.h.

65 {}

The documentation for this struct was generated from the following file: