summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Connector_Impl.h
blob: 72fd664a041cb558070a5470c91992672ab506b0 (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

// -*- C++ -*-
// ===================================================================
/**
 *  @file   HTIOP_Connector_Impl.h
 *
 *  $Id$
 *
 *  @author Priyanka Gontla <gontla_p@ociweb.com>
 */
// ===================================================================

#ifndef HTIOP_CONNECTOR_IMPL_H
#define HTIOP_CONNECTOR_IMPL_H
#include /**/ "ace/pre.h"

#include "HTIOP_Export.h"

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

#include "tao/corbafwd.h"
#include "ace/Strategies_T.h"

class TAO_ORB_Core;
class ACE_Thread_Manager;

namespace TAO
{
  namespace HTIOP
  {

    /**
     * @class HTIOP_Connect_Creation_Strategy
     *
     * @brief Creation strategy helper
     *
     * Creates the HTIOP_*_Connection_Handler object for the HTIOP_Connector
     * objects. This template class can now be used by all the Connector
     * objects instead of having to duplicate code. This class can be used
     * to set any required properties on the connection handlers at
     * creation time.
     *
     */

    template <class SVC_HANDLER>
    class Connect_Creation_Strategy : public ACE_Creation_Strategy<SVC_HANDLER>
    {
    public:

      /// Constructor. <arg> parameter is used to pass any special
      /// state/info to the service handler upon creation.  Currently used
      /// by HTIOP to pass protocol configuration properties.
      Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
                                 TAO_ORB_Core* orb_core = 0,
                                 void *arg = 0,
                                 CORBA::Boolean flag = 0);

      /// Makes HTIOP_Client_Connection_Handlers
      virtual int make_svc_handler (SVC_HANDLER *&sh);


    private:

      /// Pointer to the ORB_Core on which we are activated
      TAO_ORB_Core* orb_core_;

      /// Some info/state to be passed to the service handler we create.
      void *arg_;

      /// Are we using GIOP lite?
      CORBA::Boolean lite_flag_;
    };



    /**
     * @class HTIOP_Connect_Concurrency_Strategy
     *
     * @brief Concurrency strategy helper
     *
     * Activates the Svc_Handler, and then if the correct wait strategy is
     * in use registers the handler with the reactor.
     *
     */

    template <class SVC_HANDLER>
    class Connect_Concurrency_Strategy :
      public ACE_Concurrency_Strategy<SVC_HANDLER>
    {
    public:

      /// Constructor.
      Connect_Concurrency_Strategy (TAO_ORB_Core *orb_core);


      /// Activates the Svc_Handler, and if the right wait strategy is in
      /// use, registers the handle with the reactor.
      int activate_svc_handler (SVC_HANDLER *svc_handler,
                                void *arg);

    private:

      /// Pointer to the ORB Core.
      TAO_ORB_Core *orb_core_;

    };
  }
}

#if defined(__ACE_INLINE__)
#include "HTIOP_Connector_Impl.i"
#endif /* __ACE_INLINE__ */

#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "HTIOP_Connector_Impl.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */

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

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