// -*- C++ -*- // This is needed on LynxOS 4.0 with GCC 2.95 #include "ace/OS_NS_stdio.h" #include TAO_BEGIN_VERSIONED_NAMESPACE_DECL template ACE_INLINE T * TAO::SSLIOP::_duplicate (T * st) { // Shallow copy. // OpenSSL provides no structure-specific functions to increase the // reference count on the structure it defines, so we do it // manually. if (st != 0) CRYPTO_add (&(st->references), 1, TAO::SSLIOP::OpenSSL_traits::LOCK_ID); return st; } template ACE_INLINE T * TAO::SSLIOP::copy (T const & st) { // Deep copy. return TAO::SSLIOP::OpenSSL_traits::copy (st); } template ACE_INLINE void TAO::SSLIOP::release (T * st) { TAO::SSLIOP::OpenSSL_traits::release (st); } // ------------------------------------------------------------------- template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var::OpenSSL_st_var (void) : st_ (0) { } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var::OpenSSL_st_var (T * st) : st_ (st) { } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var::OpenSSL_st_var ( TAO::SSLIOP::OpenSSL_st_var const & st) : st_ (TAO::SSLIOP::OpenSSL_traits::_duplicate (st.ptr ())) { } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var::OpenSSL_st_var (T const & st) : st_ (TAO::SSLIOP::OpenSSL_traits::copy (st)) { } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var::~OpenSSL_st_var (void) { TAO::SSLIOP::OpenSSL_traits::release (this->st_); // TAO::SSLIOP::release (this->st_); } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var & TAO::SSLIOP::OpenSSL_st_var::operator= (T * st) { TAO::SSLIOP::OpenSSL_traits::release (this->st_); this->st_ = st; return *this; } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var & TAO::SSLIOP::OpenSSL_st_var::operator= ( TAO::SSLIOP::OpenSSL_st_var const & st) { if (this != &st) { TAO::SSLIOP::OpenSSL_traits::release (this->st_); this->st_ = TAO::SSLIOP::OpenSSL_traits::_duplicate (st.ptr ()); } return *this; } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var & TAO::SSLIOP::OpenSSL_st_var::operator= (T const & st) { if (this->st_ != &st) { TAO::SSLIOP::OpenSSL_traits::release (this->st_); this->st_ = TAO::SSLIOP::OpenSSL_traits::copy (st); } return *this; } template ACE_INLINE T const * TAO::SSLIOP::OpenSSL_st_var::operator-> (void) const { return this->st_; } template ACE_INLINE T * TAO::SSLIOP::OpenSSL_st_var::operator-> (void) { return this->st_; } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var::operator T const &() const { return *this->st_; } template ACE_INLINE TAO::SSLIOP::OpenSSL_st_var::operator T &() { return *this->st_; } template ACE_INLINE T * TAO::SSLIOP::OpenSSL_st_var::in (void) const { return this->st_; } template ACE_INLINE T *& TAO::SSLIOP::OpenSSL_st_var::inout (void) { return this->st_; } template ACE_INLINE T *& TAO::SSLIOP::OpenSSL_st_var::out (void) { TAO::SSLIOP::OpenSSL_traits::release (this->st_); this->st_ = 0; return this->st_; } template ACE_INLINE T * TAO::SSLIOP::OpenSSL_st_var::_retn (void) { // Yield ownership of the OpenSSL structure. T * st = this->st_; this->st_ = 0; return st; } template ACE_INLINE T * TAO::SSLIOP::OpenSSL_st_var::ptr (void) const { return this->st_; } TAO_END_VERSIONED_NAMESPACE_DECL