summaryrefslogtreecommitdiff
path: root/TAO/tao/ORB_Core.i
blob: 88ce0bcf8b21d4833f475e1dde7db3fc0fb4b7cf (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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// $Id$

#include "ace/Dynamic_Service.h"

#define TAO_TRF (this->resource_factory ())
#define TAO_OC_RETRIEVE(member) \
  ((this->member##_ == 0) ? (this->member##_ = this->resource_factory ()->get_##member ()) : (this->member##_) )

ACE_INLINE ACE_Reactor *
TAO_ORB_Core::reactor (ACE_Reactor *r)
{
  ACE_Reactor *old_reactor = this->reactor_;
  this->reactor_ = r;
  return old_reactor;
}

ACE_INLINE ACE_Reactor*
TAO_ORB_Core::reactor (void)
{
  return TAO_OC_RETRIEVE (reactor);
}

ACE_INLINE ACE_Thread_Manager *
TAO_ORB_Core::thr_mgr (ACE_Thread_Manager *tm)
{
  ACE_Thread_Manager *old_thr_mgr = this->thr_mgr_;
  this->thr_mgr_ = tm;
  return old_thr_mgr;
}

ACE_INLINE ACE_Thread_Manager*
TAO_ORB_Core::thr_mgr (void)
{
  return TAO_OC_RETRIEVE (thr_mgr);
}

ACE_INLINE CORBA::ORB_ptr
TAO_ORB_Core::orb (void)
{
  return TAO_OC_RETRIEVE (orb);
}

ACE_INLINE TAO_POA *
TAO_ORB_Core::root_poa (const char *adapter_name,
                        TAO_POA_Manager *poa_manager,
                        const TAO_POA_Policies *policies,
                        TAO_Object_Table *active_object_map)
{
  if (TAO_OC_RETRIEVE (root_poa) == 0)
    this->create_and_set_root_poa (adapter_name,
                                   poa_manager,
                                   policies,
                                   active_object_map);

  return this->root_poa_;
}

ACE_INLINE TAO_OA_Parameters *
TAO_ORB_Core::oa_params (void)
{
  return TAO_OC_RETRIEVE (oa_params);
}

ACE_INLINE
TAO_ORB_Parameters *
TAO_ORB_Core::orb_params(void)
{
  return TAO_OC_RETRIEVE (orb_params);
}

ACE_INLINE TAO_CONNECTOR *
TAO_ORB_Core::connector (TAO_CONNECTOR *c)
{
  TAO_CONNECTOR *old_connector = this->connector_;
  this->connector_ = c;
  return old_connector;
}

ACE_INLINE TAO_CONNECTOR *
TAO_ORB_Core::connector (void)
{
  return TAO_OC_RETRIEVE (connector);
}

ACE_INLINE TAO_ACCEPTOR *
TAO_ORB_Core::acceptor (TAO_ACCEPTOR *a)
{
  TAO_ACCEPTOR *old_acceptor = this->acceptor_;
  this->acceptor_ = a;
  return old_acceptor;
}

ACE_INLINE TAO_ACCEPTOR *
TAO_ORB_Core::acceptor (void)
{
  return TAO_OC_RETRIEVE (acceptor);
}

ACE_INLINE ACE_INET_Addr&
TAO_ORB_Core::addr (void)
{
  return *TAO_OC_RETRIEVE (addr);
}

#undef TAO_OC_RETRIEVE
#undef TAO_TRF

ACE_INLINE TAO_POA_Current *
TAO_ORB_Core::poa_current (void)
{
  return poa_current_;
}

ACE_INLINE TAO_POA_Current *
TAO_ORB_Core::poa_current (TAO_POA_Current *new_current)
{
  TAO_POA_Current *old = poa_current_;
  poa_current_ = new_current;
  return old;
}

ACE_INLINE CORBA::Boolean
TAO_ORB_Core::using_collocation (void)
{
  return this->opt_for_collocation_;
}

ACE_INLINE CORBA::Boolean
TAO_ORB_Core::using_collocation (CORBA::Boolean use_col)
{
  CORBA::Boolean retv = this->opt_for_collocation_;
  this->opt_for_collocation_ = use_col;
  return retv;
}

// Template specializations that allow the cached connection manager
// to work better.

#if defined (ACE_HAS_TEMPLATE_SPECIALIZATION)
# if defined (__ACE_INLINE__) || (!defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) && !defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA))
ACE_INLINE size_t
ACE_Hash_Addr<ACE_INET_Addr>::hash_i (const ACE_INET_Addr &addr) const
{
  return addr.get_ip_address () + addr.get_port_number ();
}
# endif /* __ACE_INLINE__ */
#endif /* ACE_HAS_TEMPLATE_SPECIALIZATION */

ACE_INLINE ACE_Allocator*
TAO_ORB_Core::data_block_allocator (void)
{
  return &this->data_block_allocator_;
}

ACE_INLINE ACE_Allocator*
TAO_ORB_Core::cdr_buffer_allocator (void)
{
  return &this->cdr_buffer_allocator_;
}