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

#include <SafetyProfileSequence.h>

List of all members.

Public Member Functions

 Element (CharT *&element, seq_flag_type release)
 Element (const Element &elt)
Elementoperator= (const CharT *rhs)
Elementoperator= (CharT *rhs)
Elementoperator= (const ::TAO::String_var< CharT > &rhs)
Elementoperator= (const ::TAO::String_Manager_T< CharT > &rhs)
 operator const CharT * () const
const CharT * in () const
CharT *& inout ()
::TAO::String_out< CharT > out () const
CharT * _retn ()

Private Member Functions

Elementmove_from (::TAO::String_var< CharT > &rhs)

Private Attributes

CharT *& element_
seq_flag_type release_

Friends

bool operator>> (DCPS::Serializer &ser, Element elt)


Detailed Description

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

Indexing a non-const string sequence yields an object of this class. This allows string memory management duing assignment.

Definition at line 129 of file SafetyProfileSequence.h.


Constructor & Destructor Documentation

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

Definition at line 130 of file SafetyProfileSequence.h.

00131         : element_(element), release_(release) {}

template<typename CharT>
OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::Element ( const Element elt  )  [inline]

Definition at line 133 of file SafetyProfileSequence.h.

00134         : element_(elt.element_), release_(elt.release_) {}


Member Function Documentation

template<typename CharT>
CharT* OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::_retn (  )  [inline]

Definition at line 170 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::element_.

00171       {
00172         CharT* const tmp = element_;
00173         element_ = StringTraits<CharT>::empty();
00174         return tmp;
00175       }

template<typename CharT>
const CharT* OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::in (  )  const [inline]

Definition at line 161 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::element_.

00161 { return element_; }

template<typename CharT>
CharT*& OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::inout (  )  [inline]

Definition at line 162 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::element_.

00162 { return element_; }

template<typename CharT>
Element& OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::move_from ( ::TAO::String_var< CharT > &  rhs  )  [inline, private]

Definition at line 178 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::element_, and OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::release_.

Referenced by OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::operator=().

00179       {
00180         if (release_) StringTraits<CharT>::free(element_);
00181         element_ = rhs._retn();
00182         return *this;
00183       }

template<typename CharT>
OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::operator const CharT * (  )  const [inline]

Definition at line 160 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::element_.

00160 { return element_; }

template<typename CharT>
Element& OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::operator= ( const ::TAO::String_Manager_T< CharT > &  rhs  )  [inline]

Definition at line 154 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::move_from().

00155       {
00156         ::TAO::String_var<CharT> tmp(rhs);
00157         return move_from(tmp);
00158       }

template<typename CharT>
Element& OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::operator= ( const ::TAO::String_var< CharT > &  rhs  )  [inline]

Definition at line 148 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::move_from().

00149       {
00150         ::TAO::String_var<CharT> tmp(rhs);
00151         return move_from(tmp);
00152       }

template<typename CharT>
Element& OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::operator= ( CharT *  rhs  )  [inline]

Definition at line 142 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::move_from().

00143       {
00144         ::TAO::String_var<CharT> tmp(rhs);
00145         return move_from(tmp);
00146       }

template<typename CharT>
Element& OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::operator= ( const CharT *  rhs  )  [inline]

Definition at line 136 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::move_from().

00137       {
00138         ::TAO::String_var<CharT> tmp(rhs);
00139         return move_from(tmp);
00140       }

template<typename CharT>
::TAO::String_out<CharT> OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::out (  )  const [inline]

Definition at line 164 of file SafetyProfileSequence.h.

References OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::element_, and OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::release_.

00165       {
00166         if (release_) StringTraits<CharT>::free(element_);
00167         return element_;
00168       }


Friends And Related Function Documentation

template<typename CharT>
bool operator>> ( DCPS::Serializer ser,
Element  elt 
) [friend]

Definition at line 188 of file SafetyProfileSequence.h.

00189       {
00190         ser.read_string(elt.out(), StringTraits<CharT>::alloc,
00191           StringTraits<CharT>::free);
00192         return ser.good_bit();
00193       }


Member Data Documentation

template<typename CharT>
CharT*& OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::element_ [private]

Definition at line 185 of file SafetyProfileSequence.h.

Referenced by OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::_retn(), OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::in(), OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::inout(), OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::move_from(), OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::operator const CharT *(), and OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::out().

template<typename CharT>
seq_flag_type OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::release_ [private]

Definition at line 186 of file SafetyProfileSequence.h.

Referenced by OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::move_from(), and OpenDDS::SafetyProfile::StringEltPolicy< CharT >::Element::out().


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