00001 // Entries.cpp,v 1.10 2006/03/14 06:14:33 jtc Exp 00002 00003 // ============================================================================ 00004 // 00005 // = LIBRARY 00006 // cos 00007 // 00008 // = FILENAME 00009 // Entries.cpp 00010 // 00011 // = AUTHOR 00012 // Marina Spivak <marina@cs.wustl.edu> 00013 // 00014 // ============================================================================ 00015 00016 #include "orbsvcs/Naming/Entries.h" 00017 00018 ACE_RCSID(Naming, Entries, "Entries.cpp,v 1.10 2006/03/14 06:14:33 jtc Exp") 00019 00020 00021 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00022 00023 TAO_IntId::TAO_IntId (void) 00024 : type_ (CosNaming::nobject) 00025 { 00026 ref_ = CORBA::Object::_nil (); 00027 } 00028 00029 TAO_IntId::TAO_IntId (CORBA::Object_ptr obj, 00030 CosNaming::BindingType type) 00031 : type_ (type) 00032 { 00033 ref_ = CORBA::Object::_duplicate (obj); 00034 } 00035 00036 TAO_IntId::TAO_IntId (const TAO_IntId &rhs) 00037 { 00038 type_ = rhs.type_; 00039 ref_ = CORBA::Object::_duplicate (rhs.ref_); 00040 } 00041 00042 TAO_IntId::~TAO_IntId (void) 00043 { 00044 CORBA::release (ref_); 00045 } 00046 00047 void 00048 TAO_IntId::operator= (const TAO_IntId &rhs) 00049 { 00050 // check for self assignment. 00051 if (&rhs == this) 00052 return; 00053 00054 type_ = rhs.type_; 00055 00056 CORBA::release (ref_); 00057 ref_ = CORBA::Object::_duplicate (rhs.ref_); 00058 } 00059 00060 TAO_ExtId::TAO_ExtId (void) 00061 : kind_ (), 00062 id_ () 00063 { 00064 } 00065 00066 TAO_ExtId::TAO_ExtId (const char *id, 00067 const char *kind) 00068 : kind_ (kind), 00069 id_ (id) 00070 { 00071 } 00072 00073 TAO_ExtId::TAO_ExtId (const TAO_ExtId &rhs) 00074 { 00075 id_ = rhs.id_; 00076 kind_ = rhs.kind_; 00077 } 00078 00079 TAO_ExtId::~TAO_ExtId (void) 00080 { 00081 } 00082 00083 const char * 00084 TAO_ExtId::id (void) 00085 { 00086 return id_.fast_rep (); 00087 } 00088 00089 const char * 00090 TAO_ExtId::kind (void) 00091 { 00092 return kind_.fast_rep (); 00093 } 00094 00095 void 00096 TAO_ExtId::operator= (const TAO_ExtId &rhs) 00097 { 00098 // Check for self assignment. 00099 if (&rhs == this) 00100 return; 00101 00102 id_ = rhs.id_; 00103 kind_ = rhs.kind_; 00104 } 00105 00106 bool 00107 TAO_ExtId::operator== (const TAO_ExtId &rhs) const 00108 { 00109 return id_ == rhs.id_ && kind_ == rhs.kind_; 00110 } 00111 00112 bool 00113 TAO_ExtId::operator!= (const TAO_ExtId &rhs) const 00114 { 00115 return id_ != rhs.id_ || kind_ != rhs.kind_; 00116 } 00117 00118 u_long 00119 TAO_ExtId::hash (void) const 00120 { 00121 ACE_CString temp (id_); 00122 temp += kind_; 00123 00124 return temp.hash (); 00125 } 00126 00127 TAO_END_VERSIONED_NAMESPACE_DECL