#include <SafetyProfileSequence.h>
Public Types | |
typedef T & | Element |
typedef const T & | ConstElement |
typedef const 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 use_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 |
Element Policy for sequences of arrays. Currently arrays of fixed-length and variable-length elements are both handled the same way, but optimizing the fixed-length element types could be done here (they don't need construction, destruction, or cookies).
Forany | the array's *_forany type generated by the IDL compiler |
Definition at line 218 of file SafetyProfileSequence.h.
typedef const T& OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::ConstElement |
Definition at line 220 of file SafetyProfileSequence.h.
typedef const T OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::ConstRawElement |
Definition at line 221 of file SafetyProfileSequence.h.
typedef T& OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::Element |
Definition at line 219 of file SafetyProfileSequence.h.
void OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::construct | ( | T * | buffer, | |
seq_size_type | n, | |||
seq_flag_type | use_cookie | |||
) | [inline, static] |
Definition at line 477 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::extra.
00480 { 00481 const seq_size_type start = use_cookie ? extra : 0; 00482 for (seq_size_type i = start; i < n + start; ++i) { 00483 TAO::Array_Traits<Forany>::construct(buffer[i]); 00484 } 00485 if (use_cookie) { 00486 *reinterpret_cast<seq_size_type*>(buffer) = n; 00487 } 00488 }
void OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::copy_n | ( | const T * | input, | |
seq_size_type | n, | |||
T * | output | |||
) | [inline, static] |
Definition at line 491 of file SafetyProfileSequence.h.
Referenced by OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::move_n().
00493 { 00494 for (seq_size_type i = 0; i < n; ++i) { 00495 TAO::Array_Traits<Forany>::copy(out[i], in[i]); 00496 } 00497 }
T * OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::destroy | ( | T * | buffer, | |
seq_size_type | n | |||
) | [inline, static] |
Definition at line 508 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::extra.
00509 { 00510 seq_size_type num = n; 00511 T* alloc = buffer; 00512 00513 if (n == INT_MAX) { 00514 alloc = buffer - extra; 00515 num = *reinterpret_cast<seq_size_type*>(alloc); 00516 } 00517 00518 for (seq_size_type i = 0; i < num; ++i) { 00519 TAO::Array_Traits<Forany>::destroy(buffer[i]); 00520 } 00521 00522 return alloc; 00523 }
static T& OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::make_element | ( | T & | elt, | |
seq_flag_type | ||||
) | [inline, static] |
Definition at line 224 of file SafetyProfileSequence.h.
static void OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::move_n | ( | T * | in, | |
seq_size_type | n, | |||
T * | out | |||
) | [inline, static] |
Definition at line 227 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::copy_n().
00227 { copy_n(in, n, out); }
void OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::reset_n | ( | T * | buffer, | |
seq_size_type | n | |||
) | [inline, static] |
Definition at line 500 of file SafetyProfileSequence.h.
00501 { 00502 for (seq_size_type i = 0; i < n; ++i) { 00503 TAO::Array_Traits<Forany>::zero(buffer[i]); 00504 } 00505 }
const seq_size_type OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::extra [static] |
(sizeof(seq_size_type) - 1) / sizeof(T) + 1
Definition at line 222 of file SafetyProfileSequence.h.
Referenced by OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::construct(), and OpenDDS::SafetyProfile::ArrayEltPolicy< Forany, T >::destroy().