Entries.cpp

Go to the documentation of this file.
00001 
00002 //=============================================================================
00003 /**
00004  *  @file    Entries.cpp
00005  *
00006  *  $Id: 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/Entries.h"
00014 
00015 ACE_RCSID(Naming, Entries, "$Id: Entries.cpp 77031 2007-02-12 15:20:17Z johnnyw $")
00016 
00017 
00018 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00019 
00020 TAO_IntId::TAO_IntId (void)
00021   : type_ (CosNaming::nobject)
00022 {
00023   ref_ = CORBA::Object::_nil ();
00024 }
00025 
00026 TAO_IntId::TAO_IntId (CORBA::Object_ptr obj,
00027                       CosNaming::BindingType type)
00028   : type_ (type)
00029 {
00030   ref_ = CORBA::Object::_duplicate (obj);
00031 }
00032 
00033 TAO_IntId::TAO_IntId (const TAO_IntId &rhs)
00034 {
00035   type_ = rhs.type_;
00036   ref_ = CORBA::Object::_duplicate (rhs.ref_);
00037 }
00038 
00039 TAO_IntId::~TAO_IntId (void)
00040 {
00041   CORBA::release (ref_);
00042 }
00043 
00044 void
00045 TAO_IntId::operator= (const TAO_IntId &rhs)
00046 {
00047   // check for self assignment.
00048   if (&rhs == this)
00049     return;
00050 
00051   type_ = rhs.type_;
00052 
00053   CORBA::release (ref_);
00054   ref_ = CORBA::Object::_duplicate (rhs.ref_);
00055 }
00056 
00057 TAO_ExtId::TAO_ExtId (void)
00058   : kind_ (),
00059     id_ ()
00060 {
00061 }
00062 
00063 TAO_ExtId::TAO_ExtId (const char *id,
00064                     const char *kind)
00065   : kind_ (kind),
00066     id_ (id)
00067 {
00068 }
00069 
00070 TAO_ExtId::TAO_ExtId (const TAO_ExtId &rhs)
00071 {
00072   id_ = rhs.id_;
00073   kind_ = rhs.kind_;
00074 }
00075 
00076 TAO_ExtId::~TAO_ExtId (void)
00077 {
00078 }
00079 
00080 const char *
00081 TAO_ExtId::id (void)
00082 {
00083   return id_.fast_rep ();
00084 }
00085 
00086 const char *
00087 TAO_ExtId::kind (void)
00088 {
00089   return kind_.fast_rep ();
00090 }
00091 
00092 void
00093 TAO_ExtId::operator= (const TAO_ExtId &rhs)
00094 {
00095   // Check for self assignment.
00096   if (&rhs == this)
00097     return;
00098 
00099   id_ = rhs.id_;
00100   kind_ = rhs.kind_;
00101 }
00102 
00103 bool
00104 TAO_ExtId::operator== (const TAO_ExtId &rhs) const
00105 {
00106   return id_ == rhs.id_ && kind_ == rhs.kind_;
00107 }
00108 
00109 bool
00110 TAO_ExtId::operator!= (const TAO_ExtId &rhs) const
00111 {
00112   return id_ != rhs.id_ || kind_ != rhs.kind_;
00113 }
00114 
00115 u_long
00116 TAO_ExtId::hash (void) const
00117 {
00118   ACE_CString temp (id_);
00119   temp += kind_;
00120 
00121   return temp.hash ();
00122 }
00123 
00124 TAO_END_VERSIONED_NAMESPACE_DECL

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