Persistent_Entries.cpp

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

Generated on Sun Jan 27 16:15:30 2008 for TAO_CosNaming by doxygen 1.3.6