Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

URL_Addr.inl

Go to the documentation of this file.
00001 // $Id: URL_Addr.inl,v 1.1.1.1.2.1 2003/04/09 12:04:07 chad Exp $
00002 
00003 #include "ace/Log_Msg.h"
00004 
00005 
00006 ACE_INLINE const ACEXML_Char *
00007 ACEXML_URL_Addr::get_path_name (void) const
00008 {
00009   return this->path_name_;
00010 }
00011 
00012 ACE_INLINE size_t
00013 ACEXML_URL_Addr::calculate_length (int ipaddr_format) const
00014 {
00015   return ACE_OS::strlen (ipaddr_format == 0 ?
00016                          this->get_host_name () : this->get_host_addr ())
00017                      + ACE_OS::strlen ("65536") // Assume the max port number.
00018                      + ACE_OS::strlen (this->get_path_name ())
00019                      + sizeof (':')
00020                      + sizeof ('/')
00021                      + sizeof ('\0'); // For trailing '\0'.
00022 }
00023 
00024 ACE_INLINE void
00025 ACEXML_URL_Addr::operator= (const ACEXML_URL_Addr &addr)
00026 {
00027   if (this->set (addr) == -1)
00028     ACE_ERROR ((LM_ERROR,
00029                 ACE_TEXT ("%p\n"),
00030                 ACE_TEXT ("ACEXML_URL_Addr::ACEXML_URL_Addr")));
00031 }
00032 
00033 ACE_INLINE u_long
00034 ACEXML_URL_Addr::hash (void) const
00035 {
00036   u_long result = this->ACE_INET_Addr::hash ()
00037                   + ACE::hash_pjw (this->get_path_name ());
00038   return result;
00039 }
00040 
00041 ACE_INLINE int
00042 ACEXML_URL_Addr::operator== (const ACEXML_URL_Addr &addr) const
00043 {
00044   return ACE_OS::strcmp (addr.get_path_name (), this->get_path_name ()) == 0
00045     && addr.get_port_number () == this->get_port_number ()
00046     && addr.get_ip_address () == this->get_ip_address ();
00047 }
00048 
00049 ACE_INLINE int
00050 ACEXML_URL_Addr::operator!= (const ACEXML_URL_Addr &addr) const
00051 {
00052   return !(*this == addr);
00053 }
00054 
00055 ACE_INLINE int
00056 ACEXML_URL_Addr::destroy (void)
00057 {
00058   // Commit suicide.
00059   delete this;
00060   return 0;
00061 }

Generated on Mon Jun 16 13:23:27 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002