summaryrefslogtreecommitdiff
path: root/TAO/tao/Thread_Lane_Resources_Manager.h
blob: e0637fbd23f6e73be71b9042f97f41b316e8f0c9 (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Thread_Lane_Resources_Manager.h
 *
 *  $Id$
 *
 *  @author  Irfan Pyarali
 */
// ============================================================================

#ifndef TAO_THREAD_LANE_RESOURCES_MANAGER_H
#define TAO_THREAD_LANE_RESOURCES_MANAGER_H

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

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

#include "ace/Service_Object.h"

#include "tao/TAO_Export.h"
#include "tao/Versioned_Namespace.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_ORB_Core;
class TAO_Thread_Lane_Resources;
class TAO_LF_Strategy;
class TAO_MProfile;

namespace CORBA
{
  class Environment;
}

/**
 * @class TAO_Thread_Lane_Resources_Manager
 *
 * @brief This class is a manager for thread resources.
 *
 * \nosubgrouping
 *
 **/
class TAO_Export TAO_Thread_Lane_Resources_Manager
{
public:

  /// Constructor.
  TAO_Thread_Lane_Resources_Manager (TAO_ORB_Core &orb_core);

  /// Destructor.
  virtual ~TAO_Thread_Lane_Resources_Manager (void);

  /// Finalize resources.
  virtual void finalize (void) = 0;

  /// Open default resources.
  virtual int open_default_resources (ACE_ENV_SINGLE_ARG_DECL) = 0;

  /// Shutdown reactor.
  virtual void shutdown_reactor (void) = 0;

  /// Cleanup transports that use the RW strategy since there are no
  /// ways to wake threads up waiting on those sockets.
  virtual void cleanup_rw_transports (void) = 0;

  /// Does @a mprofile belong to us?
  virtual int is_collocated (const TAO_MProfile& mprofile) = 0;

  /// @name Accessors
  // @{

  virtual TAO_Thread_Lane_Resources &lane_resources (void) = 0;

  virtual TAO_Thread_Lane_Resources &default_lane_resources (void) = 0;

  TAO_LF_Strategy &lf_strategy (void);

  // @}

protected:
  /// The ORB Core.
  TAO_ORB_Core * const orb_core_;

  /// The leader follower strategy
  TAO_LF_Strategy *lf_strategy_;
};

/**
 * @class TAO_Thread_Lane_Resources_Manager_Factory
 *
 * @brief This class is a factory for managers of thread resources.
 *
 * \nosubgrouping
 *
 **/
class TAO_Export TAO_Thread_Lane_Resources_Manager_Factory
  : public ACE_Service_Object
{
public:

  /// Virtual destructor.
  virtual ~TAO_Thread_Lane_Resources_Manager_Factory (void);

  /// Factory method.
  virtual TAO_Thread_Lane_Resources_Manager *
  create_thread_lane_resources_manager (TAO_ORB_Core &core) = 0;

};

TAO_END_VERSIONED_NAMESPACE_DECL


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

#endif /* TAO_THREAD_LANE_RESOURCES_MANAGER_H */