00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file SSLIOP_OpenSSL_st_T.h 00006 * 00007 * SSLIOP_OpenSSL_st_T.h,v 1.8 2006/03/14 06:14:35 jtc Exp 00008 * 00009 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_SSLIOP_OPENSSL_ST_T_H 00014 #define TAO_SSLIOP_OPENSSL_ST_T_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "ace/config-all.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 #pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/Versioned_Namespace.h" 00025 00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 namespace TAO 00029 { 00030 namespace SSLIOP 00031 { 00032 /** 00033 * @struct OpenSSL_traits 00034 * 00035 * @brief Template traits structure for OpenSSL data structures. 00036 * 00037 * Template traits structure containing constants and functions 00038 * specific to a given OpenSSL data structure. 00039 */ 00040 template <typename T> 00041 struct OpenSSL_traits; 00042 00043 /** 00044 * @name CORBA-style Reference Count Manipulation Methods 00045 * 00046 * These reference count manipulation methods are generally 00047 * specific to OpenSSL structures. 00048 */ 00049 /// Increase the reference count on the given OpenSSL structure. 00050 template <typename T> 00051 T * _duplicate (T * st); 00052 00053 /// Deep copy the given OpenSSL structure. 00054 template <typename T> 00055 T * copy (T const & st); 00056 00057 /// Decrease the reference count on the given OpenSSL structure. 00058 template <typename T> 00059 void release (T * st); 00060 00061 /** 00062 * @class OpenSSL_st_var 00063 * 00064 * @brief "_var" class for the OpenSSL @param T structure. 00065 * 00066 * This class is simply used to make operations on instances of 00067 * the OpenSSL @c T structure exception safe. It is only used 00068 * internally by the SSLIOP pluggable transport. 00069 */ 00070 template <typename T> 00071 class OpenSSL_st_var 00072 { 00073 public: 00074 00075 /** 00076 * @name Constructors 00077 * 00078 * Constructors. 00079 */ 00080 //@{ 00081 OpenSSL_st_var (void); 00082 OpenSSL_st_var (T * st); 00083 OpenSSL_st_var (OpenSSL_st_var<T> const & v); 00084 OpenSSL_st_var (T const & st); 00085 //@} 00086 00087 /// Destructor 00088 ~OpenSSL_st_var (void); 00089 00090 /** 00091 * @name Assignment operators. 00092 * 00093 * Assignment operators. 00094 */ 00095 //@{ 00096 OpenSSL_st_var<T> & operator= (T* st); 00097 OpenSSL_st_var<T> & operator= (OpenSSL_st_var<T> const & v); 00098 OpenSSL_st_var<T> & operator= (T const & st); 00099 //@} 00100 00101 T const * operator-> (void) const; 00102 T* operator-> (void); 00103 00104 operator const T& () const; 00105 operator T& (); 00106 00107 T* in (void) const; 00108 T*& inout (void); 00109 T*& out (void); 00110 T* _retn (void); 00111 T* ptr (void) const; 00112 00113 private: 00114 00115 /// The OpenSSL structure whose reference count is managed. 00116 T * st_; 00117 00118 }; 00119 } // End SSLIOP namespace. 00120 } // End TAO namespace. 00121 00122 TAO_END_VERSIONED_NAMESPACE_DECL 00123 00124 00125 #if defined (__ACE_INLINE__) 00126 #include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl" 00127 #endif /* __ACE_INLINE__ */ 00128 00129 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00130 # include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.cpp" 00131 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00132 00133 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00134 # pragma implementation ("SSLIOP_OpenSSL_st_T.cpp") 00135 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00136 00137 #include /**/ "ace/post.h" 00138 00139 #endif /* TAO_SSLIOP_OPENSSL_ST_T_H */