UNIX_Addr.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    UNIX_Addr.h
00006  *
00007  *  UNIX_Addr.h,v 4.24 2005/11/26 03:13:13 ossama Exp
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_UNIX_ADDR_H
00015 #define ACE_UNIX_ADDR_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "ace/ACE_export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS)
00026 
00027 #include "ace/Addr.h"
00028 #include "ace/Log_Msg.h"
00029 #include "ace/ACE.h"
00030 #include "ace/os_include/sys/os_un.h"
00031 
00032 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00033 
00034 /**
00035  * @class ACE_UNIX_Addr
00036  *
00037  * @brief Defines the ``UNIX domain address family'' address format.
00038  */
00039 class ACE_Export ACE_UNIX_Addr : public ACE_Addr
00040 {
00041 public:
00042   // = Initialization methods.
00043   /// Default constructor.
00044   ACE_UNIX_Addr (void);
00045 
00046   /// Copy constructor.
00047   ACE_UNIX_Addr (const ACE_UNIX_Addr &sa);
00048 
00049   /// Creates an ACE_UNIX_Addr from a string.
00050   ACE_UNIX_Addr (const char rendezvous_point[]);
00051 
00052   /// Creates an ACE_INET_Addr from a sockaddr_un structure.
00053   ACE_UNIX_Addr (const sockaddr_un *, int len);
00054 
00055   /// Creates an ACE_UNIX_Addr from another ACE_UNIX_Addr.
00056   int set (const ACE_UNIX_Addr &sa);
00057 
00058   /// Creates an ACE_UNIX_Addr from a string.
00059   int set (const char rendezvous_point[]);
00060 
00061   /// Creates an ACE_UNIX_Addr from a sockaddr_un structure.
00062   int set (const sockaddr_un *, int len);
00063 
00064   /// Return a pointer to the underlying network address.
00065   virtual void *get_addr (void) const;
00066 
00067   /// Set a pointer to the underlying network address.
00068   virtual void set_addr (void *addr, int len);
00069 
00070   /// Transform the current address into string format.
00071   virtual int addr_to_string (ACE_TCHAR addr[], size_t) const;
00072 
00073   /// Transform the string into the current addressing format.
00074   virtual int string_to_addr (const char addr[]);
00075 
00076 #if defined (ACE_HAS_WCHAR)
00077   /// Creates an ACE_UNIX_Addr from a string.
00078   ACE_UNIX_Addr (const wchar_t rendezvous_point[]);
00079 
00080   /// Creates an ACE_UNIX_Addr from a string.
00081   int set (const wchar_t rendezvous_point[]);
00082 #endif /* ACE_HAS_WCHAR */
00083 
00084   /// Compare two addresses for equality.
00085   bool operator == (const ACE_UNIX_Addr &SAP) const;
00086 
00087   /// Compare two addresses for inequality.
00088   bool operator != (const ACE_UNIX_Addr &SAP) const;
00089 
00090   /// Return the path name of the underlying rendezvous point.
00091   const char *get_path_name (void) const;
00092 
00093   /// Computes and returns hash value.
00094   virtual u_long hash (void) const;
00095 
00096   /// Dump the state of an object.
00097   void dump (void) const;
00098 
00099   /// Declare the dynamic allocation hooks.
00100   ACE_ALLOC_HOOK_DECLARE;
00101 
00102 private:
00103   /// Underlying socket address.
00104   sockaddr_un unix_addr_;
00105 };
00106 
00107 ACE_END_VERSIONED_NAMESPACE_DECL
00108 
00109 #if defined (__ACE_INLINE__)
00110 #include "ace/UNIX_Addr.inl"
00111 #endif /* __ACE_INLINE__ */
00112 
00113 #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */
00114 
00115 #include /**/ "ace/post.h"
00116 
00117 #endif /* ACE_UNIX_ADDR_H */

Generated on Thu Nov 9 09:42:09 2006 for ACE by doxygen 1.3.6