OpenDDS::SafetyProfile::VariEltPolicy< T > Struct Template Reference

#include <SafetyProfileSequence.h>

List of all members.

Public Types

typedef T & Element
typedef const T & ConstElement
typedef T ConstRawElement

Static Public Member Functions

static T & make_element (T &elt, seq_flag_type)
static void construct (T *buffer, seq_size_type n, seq_flag_type cookie)
static void copy_n (const T *input, seq_size_type n, T *output)
static void move_n (T *in, seq_size_type n, T *out)
static void reset_n (T *buffer, seq_size_type n)
static T * destroy (T *buffer, seq_size_type n)

Static Public Attributes

static const seq_size_type extra = 1


Detailed Description

template<typename T>
struct OpenDDS::SafetyProfile::VariEltPolicy< T >

Element Policy for sequence elements that are IDL "variable-length" types except for strings and arrays, which are handled separately. T element type of the sequence

Definition at line 109 of file SafetyProfileSequence.h.


Member Typedef Documentation

template<typename T>
typedef const T& OpenDDS::SafetyProfile::VariEltPolicy< T >::ConstElement

Definition at line 111 of file SafetyProfileSequence.h.

template<typename T>
typedef T OpenDDS::SafetyProfile::VariEltPolicy< T >::ConstRawElement

Definition at line 112 of file SafetyProfileSequence.h.

template<typename T>
typedef T& OpenDDS::SafetyProfile::VariEltPolicy< T >::Element

Definition at line 110 of file SafetyProfileSequence.h.


Member Function Documentation

template<typename T>
void OpenDDS::SafetyProfile::VariEltPolicy< T >::construct ( T *  buffer,
seq_size_type  n,
seq_flag_type  cookie 
) [inline, static]

Definition at line 427 of file SafetyProfileSequence.h.

00429   {
00430     std::uninitialized_fill_n(buffer + use_cookie, n, T());
00431     if (use_cookie) {
00432       *reinterpret_cast<seq_size_type*>(buffer) = n;
00433     }
00434   }

template<typename T>
void OpenDDS::SafetyProfile::VariEltPolicy< T >::copy_n ( const T *  input,
seq_size_type  n,
T *  output 
) [inline, static]

Definition at line 437 of file SafetyProfileSequence.h.

00438   {
00439     std::copy(in, in + n, out);
00440   }

template<typename T>
T * OpenDDS::SafetyProfile::VariEltPolicy< T >::destroy ( T *  buffer,
seq_size_type  n 
) [inline, static]

Definition at line 455 of file SafetyProfileSequence.h.

00456   {
00457     seq_size_type n = n_or_int_max;
00458     T* allocated = buffer;
00459 
00460     if (n_or_int_max == INT_MAX) {
00461       allocated = buffer - 1;
00462       n = *reinterpret_cast<seq_size_type*>(allocated);
00463     }
00464 
00465     for (seq_size_type i = 0; i < n; ++i) {
00466       buffer[i].~T();
00467     }
00468 
00469     return allocated;
00470   }

template<typename T>
static T& OpenDDS::SafetyProfile::VariEltPolicy< T >::make_element ( T &  elt,
seq_flag_type   
) [inline, static]

Definition at line 114 of file SafetyProfileSequence.h.

00114 { return elt; }

template<typename T>
void OpenDDS::SafetyProfile::VariEltPolicy< T >::move_n ( T *  in,
seq_size_type  n,
T *  out 
) [inline, static]

Definition at line 443 of file SafetyProfileSequence.h.

00444   {
00445     std::swap_ranges(in, in + n, out);
00446   }

template<typename T>
void OpenDDS::SafetyProfile::VariEltPolicy< T >::reset_n ( T *  buffer,
seq_size_type  n 
) [inline, static]

Definition at line 449 of file SafetyProfileSequence.h.

00450   {
00451     std::fill_n(buffer, n, T());
00452   }


Member Data Documentation

template<typename T>
const seq_size_type OpenDDS::SafetyProfile::VariEltPolicy< T >::extra = 1 [static]

Definition at line 113 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