LocalObject.cpp

Go to the documentation of this file.
00001 // $Id: LocalObject.cpp 81410 2008-04-24 09:22:08Z johnnyw $
00002 
00003 #include "tao/LocalObject.h"
00004 
00005 #if !defined (__ACE_INLINE__)
00006 # include "tao/LocalObject.inl"
00007 #endif /* ! __ACE_INLINE__ */
00008 
00009 #include "tao/SystemException.h"
00010 #include "tao/debug.h"
00011 #include "tao/ORB_Constants.h"
00012 
00013 #include "ace/Log_Msg.h"
00014 #include "ace/Guard_T.h"
00015 
00016 ACE_RCSID (tao,
00017            LocalObject,
00018            "$Id: LocalObject.cpp 81410 2008-04-24 09:22:08Z johnnyw $")
00019 
00020 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 CORBA::LocalObject::~LocalObject (void)
00023 {
00024 }
00025 
00026 // Quickly hash an object reference's representation data.  Used to
00027 // create hash tables.
00028 
00029 CORBA::ULong
00030 CORBA::LocalObject::_hash (CORBA::ULong maximum)
00031 {
00032   // Note that we reinterpret_cast to an "ptrdiff_t" instead of
00033   // CORBA::ULong since we need to first cast to an integer large
00034   // enough to hold an address to avoid compile-time warnings on some
00035   // 64-bit platforms.
00036 
00037   CORBA::ULong const hash =
00038     static_cast<CORBA::ULong> (reinterpret_cast<ptrdiff_t> (this));
00039 
00040   return hash % maximum;
00041 }
00042 
00043 // Compare two object references to see if they point to the same
00044 // object.  Used in linear searches, as in hash buckets.
00045 //
00046 // XXX would be useful to also have a trivalued comparison predicate,
00047 // such as strcmp(), to allow more comparison algorithms.
00048 
00049 CORBA::Boolean
00050 CORBA::LocalObject::_is_equivalent (CORBA::Object_ptr other_obj)
00051 {
00052   return (other_obj == this) ? true : false;
00053 }
00054 
00055 // TAO's extensions
00056 
00057 
00058 TAO::ObjectKey *
00059 CORBA::LocalObject::_key (void)
00060 {
00061   if (TAO_debug_level > 0)
00062     ACE_ERROR ((LM_ERROR,
00063                 ACE_TEXT ("(%P|%t) Cannot get _key from a LocalObject!\n")));
00064 
00065   throw ::CORBA::NO_IMPLEMENT ();
00066 }
00067 
00068 #if (TAO_HAS_MINIMUM_CORBA == 0)
00069 
00070 // NON_EXISTENT ... send a simple call to the object, which will
00071 // either elicit a FALSE response or a OBJECT_NOT_EXIST exception.  In
00072 // the latter case, return FALSE.
00073 
00074 CORBA::Boolean
00075 CORBA::LocalObject::_non_existent (void)
00076 {
00077   // Always return false.
00078   return false;
00079 }
00080 
00081 char *
00082 CORBA::LocalObject::_repository_id (void)
00083 {
00084   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00085 }
00086 
00087 #if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO)
00088 void
00089 CORBA::LocalObject::_create_request (CORBA::Context_ptr,
00090                                      const char *,
00091                                      CORBA::NVList_ptr,
00092                                      CORBA::NamedValue_ptr,
00093                                      CORBA::Request_ptr &,
00094                                      CORBA::Flags)
00095 {
00096   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
00097 }
00098 
00099 void
00100 CORBA::LocalObject::_create_request (CORBA::Context_ptr,
00101                                      const char *,
00102                                      CORBA::NVList_ptr,
00103                                      CORBA::NamedValue_ptr,
00104                                      CORBA::ExceptionList_ptr,
00105                                      CORBA::ContextList_ptr,
00106                                      CORBA::Request_ptr &,
00107                                      CORBA::Flags)
00108 {
00109   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
00110 }
00111 
00112 CORBA::Request_ptr
00113 CORBA::LocalObject::_request (const char *)
00114 {
00115   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
00116 }
00117 
00118 CORBA::Object_ptr
00119 CORBA::LocalObject::_get_component (void)
00120 {
00121   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00122 }
00123 
00124 CORBA::InterfaceDef_ptr
00125 CORBA::LocalObject::_get_interface (void)
00126 {
00127   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00128 }
00129 #endif
00130 
00131 #endif /* TAO_HAS_MINIMUM_CORBA */
00132 
00133 #if (TAO_HAS_CORBA_MESSAGING == 1)
00134 
00135 CORBA::Policy_ptr
00136 CORBA::LocalObject::_get_policy (CORBA::PolicyType)
00137 {
00138   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00139 }
00140 
00141 CORBA::Policy_ptr
00142 CORBA::LocalObject::_get_cached_policy (TAO_Cached_Policy_Type)
00143 {
00144   throw ::CORBA::NO_IMPLEMENT ();
00145 }
00146 
00147 CORBA::Object_ptr
00148 CORBA::LocalObject::_set_policy_overrides (const CORBA::PolicyList &,
00149                                            CORBA::SetOverrideType)
00150 {
00151   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00152 }
00153 
00154 CORBA::PolicyList *
00155 CORBA::LocalObject::_get_policy_overrides (const CORBA::PolicyTypeSeq &)
00156 {
00157   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00158 }
00159 
00160 CORBA::Boolean
00161 CORBA::LocalObject::_validate_connection (CORBA::PolicyList_out)
00162 {
00163   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00164 }
00165 
00166 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00167 
00168 CORBA::ORB_ptr
00169 CORBA::LocalObject::_get_orb (void)
00170 {
00171   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00172 }
00173 
00174 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7