1 #include "tao/LocalObject.h"
3 #if !defined (__ACE_INLINE__)
4 # include "tao/LocalObject.inl"
5 #endif /* ! __ACE_INLINE__ */
7 #include "tao/SystemException.h"
9 #include "tao/ORB_Constants.h"
11 #include "ace/Log_Msg.h"
12 #include "ace/Guard_T.h"
14 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 CORBA::LocalObject::~LocalObject ()
20 // Quickly hash an object reference's representation data. Used to
21 // create hash tables.
24 CORBA::LocalObject::_hash (CORBA::ULong maximum
)
26 // Note that we reinterpret_cast to an "ptrdiff_t" instead of
27 // CORBA::ULong since we need to first cast to an integer large
28 // enough to hold an address to avoid compile-time warnings on some
31 CORBA::ULong
const hash
=
32 static_cast<CORBA::ULong
> (reinterpret_cast<ptrdiff_t> (this));
34 return hash
% maximum
;
37 // Compare two object references to see if they point to the same
38 // object. Used in linear searches, as in hash buckets.
40 // XXX would be useful to also have a trivalued comparison predicate,
41 // such as strcmp(), to allow more comparison algorithms.
44 CORBA::LocalObject::_is_equivalent (CORBA::Object_ptr other_obj
)
46 return (other_obj
== this) ? true : false;
53 CORBA::LocalObject::_key ()
55 if (TAO_debug_level
> 0)
56 TAOLIB_ERROR ((LM_ERROR
,
57 ACE_TEXT ("TAO (%P|%t) - Cannot get _key from a LocalObject!\n")));
59 throw ::CORBA::NO_IMPLEMENT ();
62 #if (TAO_HAS_MINIMUM_CORBA == 0)
64 // NON_EXISTENT ... send a simple call to the object, which will
65 // either elicit a FALSE response or a OBJECT_NOT_EXIST exception. In
66 // the latter case, return FALSE.
69 CORBA::LocalObject::_non_existent ()
71 // Always return false.
76 CORBA::LocalObject::_repository_id ()
78 if (TAO_debug_level
> 0)
79 TAOLIB_ERROR ((LM_ERROR
,
80 ACE_TEXT ("TAO (%P|%t) - Cannot get _repository_id from a LocalObject!\n")));
82 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
85 #if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO)
87 CORBA::LocalObject::_create_request (CORBA::Context_ptr
,
90 CORBA::NamedValue_ptr
,
94 if (TAO_debug_level
> 0)
95 TAOLIB_ERROR ((LM_ERROR
,
96 ACE_TEXT ("TAO (%P|%t) - Cannot call _create_request for a LocalObject!\n")));
98 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 4, CORBA::COMPLETED_NO
);
102 CORBA::LocalObject::_create_request (CORBA::Context_ptr
,
105 CORBA::NamedValue_ptr
,
106 CORBA::ExceptionList_ptr
,
107 CORBA::ContextList_ptr
,
108 CORBA::Request_ptr
&,
111 if (TAO_debug_level
> 0)
112 TAOLIB_ERROR ((LM_ERROR
,
113 ACE_TEXT ("TAO (%P|%t) - Cannot call _create_request for a LocalObject!\n")));
115 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 4, CORBA::COMPLETED_NO
);
119 CORBA::LocalObject::_request (const char *)
121 if (TAO_debug_level
> 0)
122 TAOLIB_ERROR ((LM_ERROR
,
123 ACE_TEXT ("TAO (%P|%t) - Cannot call _request for a LocalObject!\n")));
125 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 4, CORBA::COMPLETED_NO
);
129 CORBA::LocalObject::_get_component ()
131 if (TAO_debug_level
> 0)
132 TAOLIB_ERROR ((LM_ERROR
,
133 ACE_TEXT ("TAO (%P|%t) - Cannot call _get_component for a LocalObject!\n")));
135 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
138 CORBA::InterfaceDef_ptr
139 CORBA::LocalObject::_get_interface ()
141 if (TAO_debug_level
> 0)
142 TAOLIB_ERROR ((LM_ERROR
,
143 ACE_TEXT ("TAO (%P|%t) - Cannot call _get_interface for a LocalObject!\n")));
145 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
149 #endif /* TAO_HAS_MINIMUM_CORBA */
151 #if (TAO_HAS_CORBA_MESSAGING == 1)
154 CORBA::LocalObject::_get_policy (CORBA::PolicyType
)
156 if (TAO_debug_level
> 0)
157 TAOLIB_ERROR ((LM_ERROR
,
158 ACE_TEXT ("TAO (%P|%t) - Cannot call _get_policy for a LocalObject!\n")));
160 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
164 CORBA::LocalObject::_get_cached_policy (TAO_Cached_Policy_Type
)
166 if (TAO_debug_level
> 0)
167 TAOLIB_ERROR ((LM_ERROR
,
168 ACE_TEXT ("TAO (%P|%t) - Cannot call _get_cached_policy for a LocalObject!\n")));
170 throw ::CORBA::NO_IMPLEMENT ();
174 CORBA::LocalObject::_set_policy_overrides (const CORBA::PolicyList
&,
175 CORBA::SetOverrideType
)
177 if (TAO_debug_level
> 0)
178 TAOLIB_ERROR ((LM_ERROR
,
179 ACE_TEXT ("TAO (%P|%t) - Cannot call _set_policy_overrides for a LocalObject!\n")));
181 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
185 CORBA::LocalObject::_get_policy_overrides (const CORBA::PolicyTypeSeq
&)
187 if (TAO_debug_level
> 0)
188 TAOLIB_ERROR ((LM_ERROR
,
189 ACE_TEXT ("TAO (%P|%t) - Cannot call _get_policy_overrides for a LocalObject!\n")));
191 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
195 CORBA::LocalObject::_validate_connection (CORBA::PolicyList_out
)
197 if (TAO_debug_level
> 0)
198 TAOLIB_ERROR ((LM_ERROR
,
199 ACE_TEXT ("TAO (%P|%t) - Cannot call _validate_connection for a LocalObject!\n")));
201 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
204 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
207 CORBA::LocalObject::_get_orb ()
209 if (TAO_debug_level
> 0)
210 TAOLIB_ERROR ((LM_ERROR
,
211 ACE_TEXT ("TAO (%P|%t) - Cannot call _get_orb for a LocalObject!\n")));
213 throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID
| 8, CORBA::COMPLETED_NO
);
216 TAO_END_VERSIONED_NAMESPACE_DECL