summaryrefslogtreecommitdiff
path: root/trunk/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.h
blob: 1fee4c1504b9d0cfaaadb67ee147b67c8b8a2c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// -*- C++ -*-

//=============================================================================
/**
 *  @file   SSLIOP_OpenSSL_st_T.h
 *
 *  $Id$
 *
 *  @author Ossama Othman <ossama@dre.vanderbilt.edu>
 */
//=============================================================================

#ifndef TAO_SSLIOP_OPENSSL_ST_T_H
#define TAO_SSLIOP_OPENSSL_ST_T_H

#include /**/ "ace/pre.h"

#include "ace/config-all.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/Versioned_Namespace.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace TAO
{
  namespace SSLIOP
  {
    /**
     * @struct OpenSSL_traits
     *
     * @brief Template traits structure for OpenSSL data structures.
     *
     * Template traits structure containing constants and functions
     * specific to a given OpenSSL data structure.
     */
    template <typename T>
    struct OpenSSL_traits;

    /**
     * @name CORBA-style Reference Count Manipulation Methods
     *
     * These reference count manipulation methods are generally
     * specific to OpenSSL structures.
     */
    /// Increase the reference count on the given OpenSSL structure.
    template <typename T>
    T * _duplicate (T * st);

    /// Deep copy the given OpenSSL structure.
    template <typename T>
    T * copy (T const & st);

    /// Decrease the reference count on the given OpenSSL structure.
    template <typename T>
    void release (T * st);

    /**
     * @class OpenSSL_st_var
     *
     * @brief "_var" class for the OpenSSL @param T structure.
     *
     * This class is simply used to make operations on instances of
     * the OpenSSL @c T structure exception safe.  It is only used
     * internally by the SSLIOP pluggable transport.
     */
    template <typename T>
    class OpenSSL_st_var
    {
    public:

      /**
       * @name Constructors
       *
       * Constructors.
       */
      //@{
      OpenSSL_st_var (void);
      OpenSSL_st_var (T * st);
      OpenSSL_st_var (OpenSSL_st_var<T> const & v);
      OpenSSL_st_var (T const & st);
      //@}

      /// Destructor
      ~OpenSSL_st_var (void);

      /**
       * @name Assignment operators.
       *
       * Assignment operators.
       */
      //@{
      OpenSSL_st_var<T> & operator= (T* st);
      OpenSSL_st_var<T> & operator= (OpenSSL_st_var<T> const & v);
      OpenSSL_st_var<T> & operator= (T const & st);
      //@}

      T const * operator-> (void) const;
      T* operator-> (void);

      operator const T& () const;
      operator T& ();

      T*  in (void) const;
      T*& inout (void);
      T*& out (void);
      T*  _retn (void);
      T*  ptr (void) const;

    private:

      /// The OpenSSL structure whose reference count is managed.
      T * st_;

    };
  }  // End SSLIOP namespace.
}  // End TAO namespace.

TAO_END_VERSIONED_NAMESPACE_DECL


#if defined (__ACE_INLINE__)
#include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.inl"
#endif  /* __ACE_INLINE__ */

#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
# include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */

#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
# pragma implementation ("SSLIOP_OpenSSL_st_T.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */

#include /**/ "ace/post.h"

#endif  /* TAO_SSLIOP_OPENSSL_ST_T_H */