OpenDDS::SafetyProfile::StringEltPolicy< CharT > Struct Template Reference

#include <SafetyProfileSequence.h>

List of all members.

Classes

struct  Element

Public Types

typedef const CharT * ConstElement
typedef const CharT * ConstRawElement

Static Public Member Functions

static Element make_element (CharT *&elt, seq_flag_type release)
static void construct (CharT **buf, seq_size_type n, seq_flag_type cookie)
static void copy_n (const CharT *const *in, seq_size_type n, CharT **out)
static void move_n (CharT **in, seq_size_type n, CharT **out)
static void reset_n (CharT **, seq_size_type)
static CharT ** destroy (CharT **buffer, seq_size_type n)

Static Public Attributes

static const seq_size_type extra = 1

Detailed Description

template<typename CharT>
struct OpenDDS::SafetyProfile::StringEltPolicy< CharT >

Element Policy for sequences of strings.

Template Parameters:
CharT FACE::Char or FACE::WChar

Definition at line 126 of file SafetyProfileSequence.h.


Member Typedef Documentation

template<typename CharT >
typedef const CharT* OpenDDS::SafetyProfile::StringEltPolicy< CharT >::ConstElement

Definition at line 202 of file SafetyProfileSequence.h.

template<typename CharT >
typedef const CharT* OpenDDS::SafetyProfile::StringEltPolicy< CharT >::ConstRawElement

Definition at line 203 of file SafetyProfileSequence.h.


Member Function Documentation

template<typename CharT >
void OpenDDS::SafetyProfile::StringEltPolicy< CharT >::construct ( CharT **  buf,
seq_size_type  n,
seq_flag_type  cookie 
) [inline, static]

Definition at line 366 of file SafetyProfileSequence.h.

00368   {
00369     for (seq_size_type i = use_cookie; i < n + use_cookie; ++i) {
00370       buffer[i] = StringTraits<CharT>::empty();
00371     }
00372     if (use_cookie) {
00373       *reinterpret_cast<seq_size_type*>(buffer) = n;
00374     }
00375   }

template<typename CharT >
void OpenDDS::SafetyProfile::StringEltPolicy< CharT >::copy_n ( const CharT *const *  in,
seq_size_type  n,
CharT **  out 
) [inline, static]

Definition at line 378 of file SafetyProfileSequence.h.

00380   {
00381     for (seq_size_type i = 0; i < n; ++i) {
00382       StringTraits<CharT>::free(out[i]);
00383       out[i] = StringTraits<CharT>::dup(in[i]);
00384     }
00385   }

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

Definition at line 406 of file SafetyProfileSequence.h.

00408   {
00409     seq_size_type n = n_or_int_max;
00410     CharT** allocated = buffer;
00411 
00412     if (n_or_int_max == INT_MAX) {
00413       allocated = buffer - 1;
00414       n = *reinterpret_cast<seq_size_type*>(allocated);
00415     }
00416 
00417     for (seq_size_type i = 0; i < n; ++i) {
00418       StringTraits<CharT>::free(buffer[i]);
00419     }
00420 
00421     return allocated;
00422   }

template<typename CharT >
static Element OpenDDS::SafetyProfile::StringEltPolicy< CharT >::make_element ( CharT *&  elt,
seq_flag_type  release 
) [inline, static]

Definition at line 197 of file SafetyProfileSequence.h.

00198     {
00199       return Element(elt, release);
00200     }

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

Definition at line 388 of file SafetyProfileSequence.h.

References OpenDDS::DCPS::swap().

00390   {
00391     for (seq_size_type i = 0; i < n; ++i) {
00392       std::swap(in[i], out[i]);
00393     }
00394   }

Here is the call graph for this function:

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

Definition at line 397 of file SafetyProfileSequence.h.

00398   {
00399     for (seq_size_type i = 0; i < n; ++i) {
00400       StringTraits<CharT>::free(buffer[i]);
00401       buffer[i] = StringTraits<CharT>::empty();
00402     }
00403   }


Member Data Documentation

template<typename CharT >
const seq_size_type OpenDDS::SafetyProfile::StringEltPolicy< CharT >::extra = 1 [static]

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