00001 #ifndef guard_string_const_sequence_element_hpp 00002 #define guard_string_const_sequence_element_hpp 00003 /** 00004 * @file 00005 * 00006 * @brief Implement the type returned by const operator[] in string 00007 * sequences. 00008 * 00009 * $Id: String_Const_Sequence_Element_T.h 79363 2007-08-16 11:36:29Z johnnyw $ 00010 * 00011 * @author Carlos O'Ryan and Johnny Willemsen 00012 */ 00013 00014 #include "tao/Basic_Types.h" 00015 00016 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00017 00018 namespace TAO 00019 { 00020 namespace details 00021 { 00022 00023 template<typename traits> 00024 class string_const_sequence_element 00025 { 00026 public: 00027 typedef typename traits::char_type character_type; 00028 typedef character_type * value_type; 00029 typedef character_type const * const_value_type; 00030 typedef typename traits::string_var string_var; 00031 typedef typename traits::string_mgr string_mgr; 00032 00033 public: 00034 string_const_sequence_element(value_type const & e, CORBA::Boolean release) 00035 : element_(&e) 00036 , release_(release) 00037 { 00038 } 00039 00040 string_const_sequence_element( 00041 string_const_sequence_element const & rhs) 00042 : element_(rhs.element_) 00043 , release_(rhs.release_) 00044 { 00045 } 00046 00047 ~string_const_sequence_element() 00048 { 00049 } 00050 00051 inline operator const_value_type() const 00052 { 00053 return *this->element_; 00054 } 00055 00056 inline const character_type *in (void) const 00057 { 00058 return *this->element_; 00059 } 00060 00061 CORBA::Boolean release() const 00062 { 00063 return this->release_; 00064 } 00065 00066 private: 00067 // This function is not implemented 00068 string_const_sequence_element(); 00069 string_const_sequence_element & operator=(string_const_sequence_element const & rhs); 00070 00071 private: 00072 const_value_type const * element_; 00073 CORBA::Boolean const release_; 00074 }; 00075 00076 } // namespace details 00077 } // namespace CORBA 00078 00079 TAO_END_VERSIONED_NAMESPACE_DECL 00080 00081 #endif // guard_string_const_sequence_element_hpp