LocalObject.cpp

Go to the documentation of this file.
00001 // $Id: LocalObject.cpp 78734 2007-07-02 16:16:24Z mitza $
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 78734 2007-07-02 16:16:24Z mitza $")
00019 
00020 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 CORBA::LocalObject::~LocalObject (void)
00023 {
00024 }
00025 
00026 void
00027 CORBA::LocalObject::_add_ref (void)
00028 {
00029   // Do nothing as per CCM spec.
00030 }
00031 
00032 void
00033 CORBA::LocalObject::_remove_ref (void)
00034 {
00035   // Do nothing as per CCM spec.
00036 }
00037 
00038 // Quickly hash an object reference's representation data.  Used to
00039 // create hash tables.
00040 
00041 CORBA::ULong
00042 CORBA::LocalObject::_hash (CORBA::ULong maximum)
00043 {
00044   // Note that we reinterpret_cast to an "ptrdiff_t" instead of
00045   // CORBA::ULong since we need to first cast to an integer large
00046   // enough to hold an address to avoid compile-time warnings on some
00047   // 64-bit platforms.
00048 
00049   CORBA::ULong const hash =
00050     static_cast<CORBA::ULong> (reinterpret_cast<ptrdiff_t> (this));
00051 
00052   return hash % maximum;
00053 }
00054 
00055 // Compare two object references to see if they point to the same
00056 // object.  Used in linear searches, as in hash buckets.
00057 //
00058 // XXX would be useful to also have a trivalued comparison predicate,
00059 // such as strcmp(), to allow more comparison algorithms.
00060 
00061 CORBA::Boolean
00062 CORBA::LocalObject::_is_equivalent (CORBA::Object_ptr other_obj)
00063 {
00064   return (other_obj == this) ? true : false;
00065 }
00066 
00067 // TAO's extensions
00068 
00069 
00070 TAO::ObjectKey *
00071 CORBA::LocalObject::_key (void)
00072 {
00073   if (TAO_debug_level > 0)
00074     ACE_ERROR ((LM_ERROR,
00075                 ACE_TEXT ("(%P|%t) Cannot get _key from a LocalObject!\n")));
00076 
00077   throw ::CORBA::NO_IMPLEMENT ();
00078 }
00079 
00080 #if (TAO_HAS_MINIMUM_CORBA == 0)
00081 
00082 // NON_EXISTENT ... send a simple call to the object, which will
00083 // either elicit a FALSE response or a OBJECT_NOT_EXIST exception.  In
00084 // the latter case, return FALSE.
00085 
00086 CORBA::Boolean
00087 CORBA::LocalObject::_non_existent (void)
00088 {
00089   // Always return false.
00090   return false;
00091 }
00092 
00093 void
00094 CORBA::LocalObject::_create_request (CORBA::Context_ptr,
00095                                      const char *,
00096                                      CORBA::NVList_ptr,
00097                                      CORBA::NamedValue_ptr,
00098                                      CORBA::Request_ptr &,
00099                                      CORBA::Flags)
00100 {
00101   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
00102 }
00103 
00104 void
00105 CORBA::LocalObject::_create_request (CORBA::Context_ptr,
00106                                      const char *,
00107                                      CORBA::NVList_ptr,
00108                                      CORBA::NamedValue_ptr,
00109                                      CORBA::ExceptionList_ptr,
00110                                      CORBA::ContextList_ptr,
00111                                      CORBA::Request_ptr &,
00112                                      CORBA::Flags)
00113 {
00114   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
00115 }
00116 
00117 CORBA::Request_ptr
00118 CORBA::LocalObject::_request (const char *)
00119 {
00120   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
00121 }
00122 
00123 CORBA::Object_ptr
00124 CORBA::LocalObject::_get_component (void)
00125 {
00126   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00127 }
00128 
00129 char *
00130 CORBA::LocalObject::_repository_id (void)
00131 {
00132   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00133 }
00134 
00135 CORBA::InterfaceDef_ptr
00136 CORBA::LocalObject::_get_interface (void)
00137 {
00138   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00139 }
00140 
00141 CORBA::ImplementationDef_ptr
00142 CORBA::LocalObject::_get_implementation (void)
00143 {
00144   throw ::CORBA::NO_IMPLEMENT ();
00145 }
00146 
00147 #endif /* TAO_HAS_MINIMUM_CORBA */
00148 
00149 #if (TAO_HAS_CORBA_MESSAGING == 1)
00150 
00151 CORBA::Policy_ptr
00152 CORBA::LocalObject::_get_policy (CORBA::PolicyType)
00153 {
00154   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00155 }
00156 
00157 CORBA::Policy_ptr
00158 CORBA::LocalObject::_get_cached_policy (TAO_Cached_Policy_Type)
00159 {
00160   throw ::CORBA::NO_IMPLEMENT ();
00161 }
00162 
00163 CORBA::Object_ptr
00164 CORBA::LocalObject::_set_policy_overrides (const CORBA::PolicyList &,
00165                                            CORBA::SetOverrideType)
00166 {
00167   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00168 }
00169 
00170 CORBA::PolicyList *
00171 CORBA::LocalObject::_get_policy_overrides (const CORBA::PolicyTypeSeq &)
00172 {
00173   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00174 }
00175 
00176 CORBA::Boolean
00177 CORBA::LocalObject::_validate_connection (CORBA::PolicyList_out)
00178 {
00179   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00180 }
00181 
00182 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00183 
00184 CORBA::ORB_ptr
00185 CORBA::LocalObject::_get_orb (void)
00186 {
00187   throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
00188 }
00189 
00190 // ****************************************************************
00191 
00192 void
00193 TAO_Local_RefCounted_Object::_add_ref (void)
00194 {
00195   this->_tao_actual_add_ref ();
00196 }
00197 
00198 void
00199 TAO_Local_RefCounted_Object::_remove_ref (void)
00200 {
00201   this->_tao_actual_remove_ref ();
00202 }
00203 
00204 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Sun Jan 27 13:07:33 2008 for TAO by doxygen 1.3.6