Persistent_Entries.cpp

Go to the documentation of this file.
00001 // Persistent_Entries.cpp,v 1.8 2006/03/14 06:14:34 jtc Exp
00002 
00003 // ============================================================================
00004 //
00005 // = LIBRARY
00006 //    cos
00007 //
00008 // = FILENAME
00009 //    Persistent_Entries.cpp
00010 //
00011 // = AUTHOR
00012 //    Marina Spivak <marina@cs.wustl.edu>
00013 //
00014 // ============================================================================
00015 
00016 #include "orbsvcs/Naming/Persistent_Entries.h"
00017 #include "ace/SString.h"
00018 
00019 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00020 
00021 TAO_Persistent_IntId::TAO_Persistent_IntId (void)
00022   : ref_ (0),
00023     type_ (CosNaming::nobject)
00024 {
00025 }
00026 
00027 TAO_Persistent_IntId::TAO_Persistent_IntId (char * obj_ref,
00028                                             CosNaming::BindingType type)
00029   : ref_ (obj_ref),
00030     type_ (type)
00031 {
00032 }
00033 
00034 TAO_Persistent_IntId::TAO_Persistent_IntId (const TAO_Persistent_IntId &rhs)
00035 {
00036   ref_ = rhs.ref_;
00037   type_ = rhs.type_;
00038 }
00039 
00040 TAO_Persistent_IntId::~TAO_Persistent_IntId (void)
00041 {
00042 }
00043 
00044 void
00045 TAO_Persistent_IntId::operator= (const TAO_Persistent_IntId &rhs)
00046 {
00047   // check for self assignment.
00048   if (&rhs == this)
00049     return;
00050 
00051   type_ = rhs.type_;
00052   ref_ = rhs.ref_;
00053 }
00054 
00055 TAO_Persistent_ExtId::TAO_Persistent_ExtId (void)
00056   : id_ (0),
00057     kind_ (0)
00058 {
00059 }
00060 
00061 TAO_Persistent_ExtId::TAO_Persistent_ExtId (const char *id,
00062                                             const char *kind)
00063   : id_ (id),
00064     kind_ (kind)
00065 
00066 {
00067 }
00068 
00069 TAO_Persistent_ExtId::TAO_Persistent_ExtId (const TAO_Persistent_ExtId &rhs)
00070 {
00071   id_ = rhs.id_;
00072   kind_ = rhs.kind_;
00073 }
00074 
00075 TAO_Persistent_ExtId::~TAO_Persistent_ExtId (void)
00076 {
00077 }
00078 
00079 void
00080 TAO_Persistent_ExtId::operator= (const TAO_Persistent_ExtId &rhs)
00081 {
00082   // Check for self assignment.
00083   if (&rhs == this)
00084     return;
00085 
00086   id_ = rhs.id_;
00087   kind_ = rhs.kind_;
00088 }
00089 
00090 bool
00091 TAO_Persistent_ExtId::operator== (const TAO_Persistent_ExtId &rhs) const
00092 {
00093   return (ACE_OS::strcmp (id_, rhs.id_) == 0)
00094     && (ACE_OS::strcmp (kind_, rhs.kind_) == 0);
00095 }
00096 
00097 bool
00098 TAO_Persistent_ExtId::operator!= (const TAO_Persistent_ExtId &rhs) const
00099 {
00100   return (ACE_OS::strcmp (id_, rhs.id_) != 0)
00101     || (ACE_OS::strcmp (kind_, rhs.kind_) != 0);
00102 }
00103 
00104 u_long
00105 TAO_Persistent_ExtId::hash (void) const
00106 {
00107   ACE_CString temp (id_);
00108   temp += kind_;
00109 
00110   return temp.hash ();
00111 }
00112 
00113 const char *
00114 TAO_Persistent_ExtId::id (void)
00115 {
00116   return id_;
00117 }
00118 
00119 const char *
00120 TAO_Persistent_ExtId::kind (void)
00121 {
00122   return kind_;
00123 }
00124 
00125 TAO_Persistent_Index_IntId::TAO_Persistent_Index_IntId (void)
00126   : counter_ (0),
00127     hash_map_ (0)
00128 {
00129 }
00130 
00131 TAO_Persistent_Index_IntId::TAO_Persistent_Index_IntId (ACE_UINT32 *counter,
00132                                                         ACE_Hash_Map_With_Allocator<TAO_Persistent_ExtId,
00133                                                         TAO_Persistent_IntId> * hash_map)
00134   : counter_ (counter),
00135     hash_map_ (hash_map)
00136 {
00137 }
00138 
00139 TAO_Persistent_Index_IntId::TAO_Persistent_Index_IntId (const TAO_Persistent_Index_IntId &rhs)
00140 {
00141   counter_ = rhs.counter_;
00142   hash_map_ = rhs.hash_map_;
00143 }
00144 
00145 TAO_Persistent_Index_IntId::~TAO_Persistent_Index_IntId (void)
00146 {
00147 }
00148 
00149 void
00150 TAO_Persistent_Index_IntId::operator= (const TAO_Persistent_Index_IntId &rhs)
00151 {
00152   // check for self assignment.
00153   if (&rhs == this)
00154     return;
00155 
00156   counter_ = rhs.counter_;
00157   hash_map_ = rhs.hash_map_;
00158 }
00159 
00160 TAO_Persistent_Index_ExtId::TAO_Persistent_Index_ExtId (void)
00161   : poa_id_ (0)
00162 {
00163 }
00164 
00165 TAO_Persistent_Index_ExtId::TAO_Persistent_Index_ExtId (const char *poa_id)
00166   : poa_id_ (poa_id)
00167 {
00168 }
00169 
00170 TAO_Persistent_Index_ExtId::TAO_Persistent_Index_ExtId (const TAO_Persistent_Index_ExtId &rhs)
00171 {
00172   poa_id_ = rhs.poa_id_;
00173 }
00174 
00175 TAO_Persistent_Index_ExtId::~TAO_Persistent_Index_ExtId (void)
00176 {
00177 }
00178 
00179 void
00180 TAO_Persistent_Index_ExtId::operator= (const TAO_Persistent_Index_ExtId &rhs)
00181 {
00182   // Check for self assignment.
00183   if (&rhs == this)
00184     return;
00185 
00186   poa_id_ = rhs.poa_id_;
00187 }
00188 
00189 bool
00190 TAO_Persistent_Index_ExtId::operator== (const TAO_Persistent_Index_ExtId &rhs) const
00191 {
00192   return (ACE_OS::strcmp (poa_id_, rhs.poa_id_) == 0);
00193 }
00194 
00195 bool
00196 TAO_Persistent_Index_ExtId::operator!= (const TAO_Persistent_Index_ExtId &rhs) const
00197 {
00198   return (ACE_OS::strcmp (poa_id_, rhs.poa_id_) != 0);
00199 }
00200 
00201 u_long
00202 TAO_Persistent_Index_ExtId::hash (void) const
00203 {
00204   ACE_CString temp (poa_id_);
00205   return temp.hash ();
00206 }
00207 
00208 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 13:57:02 2006 for TAO_CosNaming by doxygen 1.3.6