TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy > Class Template Reference

Template class for IN unbounded (w)string argument. More...

#include <UB_String_Argument_T.h>

Inheritance diagram for TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >:

Inheritance graph
[legend]
Collaboration diagram for TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 In_UB_String_Clonable_Argument_T (const typename S_var::s_traits::char_type *x)
virtual ~In_UB_String_Clonable_Argument_T (void)
virtual Argumentclone (void)
 Template method to clone a TAO Argument.

Private Attributes

bool is_clone_

Detailed Description

template<typename S_var, class Insert_Policy>
class TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >

Template class for IN unbounded (w)string argument.

Definition at line 60 of file UB_String_Argument_T.h.


Constructor & Destructor Documentation

template<typename S_var, class Insert_Policy>
ACE_INLINE TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >::In_UB_String_Clonable_Argument_T ( const typename S_var::s_traits::char_type *  x  ) 

Definition at line 28 of file UB_String_Argument_T.inl.

00030   : In_UB_String_Argument_T<S_var,Insert_Policy> (x),
00031     is_clone_ (false)
00032 {
00033 }

template<typename S_var, class Insert_Policy>
TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >::~In_UB_String_Clonable_Argument_T ( void   )  [virtual]

Definition at line 39 of file UB_String_Argument_T.cpp.

00040 {
00041   if (this->is_clone_)
00042     {
00043       typename S_var::s_traits::char_type * tmp =
00044            const_cast<typename S_var::s_traits::char_type *> (this->x_);
00045       delete [] tmp;
00046     }
00047 }


Member Function Documentation

template<typename S_var, class Insert_Policy>
TAO::Argument * TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >::clone ( void   )  [virtual]

Template method to clone a TAO Argument.

Reimplemented from TAO::Argument.

Definition at line 52 of file UB_String_Argument_T.cpp.

References TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >::is_clone_, ACE_OS::strlen(), and ACE_OS::strncpy().

00053 {
00054   size_t len = ACE_OS::strlen (this->x_);
00055   typename S_var::s_traits::char_type * clone_x =
00056            new typename S_var::s_traits::char_type [len + 1];
00057   ACE_OS::strncpy (clone_x, this->x_, len);
00058   clone_x[len] = '\0';
00059   In_UB_String_Clonable_Argument_T<S_var,Insert_Policy>* clone_arg =
00060        new In_UB_String_Clonable_Argument_T<S_var,Insert_Policy> (clone_x);
00061   clone_arg->is_clone_ = true;
00062   return clone_arg;
00063 }


Member Data Documentation

template<typename S_var, class Insert_Policy>
bool TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >::is_clone_ [private]

Definition at line 70 of file UB_String_Argument_T.h.

Referenced by TAO::In_UB_String_Clonable_Argument_T< S_var, Insert_Policy >::clone().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:12 2010 for TAO by  doxygen 1.4.7