summaryrefslogtreecommitdiff
path: root/TAO/tao/UB_String_Argument_T.cpp
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2006-08-14 12:50:21 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2006-08-14 12:50:21 +0000
commita685dbd0e218572fdac32e7ab0d9ff3ea0e75a03 (patch)
tree9d76b7710d5f6320f4e3a3d958c0807374059250 /TAO/tao/UB_String_Argument_T.cpp
parent881071ba13cadea26f4fdb105340f3c6f46e9d56 (diff)
downloadATCD-a685dbd0e218572fdac32e7ab0d9ff3ea0e75a03.tar.gz
ChangeLogTag: Mon Aug 14 12:49:11 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tao/UB_String_Argument_T.cpp')
-rw-r--r--TAO/tao/UB_String_Argument_T.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/TAO/tao/UB_String_Argument_T.cpp b/TAO/tao/UB_String_Argument_T.cpp
index 9afe7216324..f109789b930 100644
--- a/TAO/tao/UB_String_Argument_T.cpp
+++ b/TAO/tao/UB_String_Argument_T.cpp
@@ -5,6 +5,7 @@
#include "tao/UB_String_Argument_T.h"
#include "tao/CDR.h"
+#include "ace/OS_NS_string.h"
#if !defined (__ACE_INLINE__)
#include "tao/UB_String_Argument_T.inl"
@@ -36,6 +37,34 @@ TAO::In_UB_String_Argument_T<S_var,Insert_Policy>::interceptor_value (
#endif /* TAO_HAS_INTERCEPTORS */
+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)
+{
+ if (this->is_clone_)
+ {
+ typename S_var::s_traits::char_type * tmp =
+ const_cast<typename S_var::s_traits::char_type *> (this->x_);
+ delete [] tmp;
+ }
+}
+
+template<typename S_var,
+ class Insert_Policy>
+TAO::Argument*
+TAO::In_UB_String_Clonable_Argument_T<S_var,Insert_Policy>::clone ()
+{
+ size_t len = ACE_OS::strlen (this->x_);
+ typename S_var::s_traits::char_type * clone_x =
+ new typename S_var::s_traits::char_type [len + 1];
+ ACE_OS::strncpy (clone_x, this->x_, len);
+ clone_x[len] = '\0';
+ In_UB_String_Clonable_Argument_T<S_var,Insert_Policy>* clone_arg =
+ new In_UB_String_Clonable_Argument_T<S_var,Insert_Policy> (clone_x);
+ clone_arg->is_clone_ = true;
+ return clone_arg;
+}
+
// ===========================================================
template<typename S_var,