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

SPIPE_Addr.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    SPIPE_Addr.h
00006  *
00007  *  $Id: SPIPE_Addr.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //==========================================================================
00012 
00013 
00014 #ifndef ACE_SPIPE_ADDR_H
00015 #define ACE_SPIPE_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 #include "ace/Addr.h"
00026 #include "ace/OS.h"
00027 
00028 /**
00029  * @class ACE_SPIPE_Addr
00030  *
00031  * @brief Defines the SVR4 STREAM pipe address family address format.
00032  */
00033 class ACE_Export ACE_SPIPE_Addr : public ACE_Addr
00034 {
00035 public:
00036   // = Initialization methods.
00037   /// Default constructor.
00038   ACE_SPIPE_Addr (void);
00039 
00040   /// Copy constructor.
00041   ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa);
00042 
00043   /// Create a ACE_SPIPE_Addr from a rendezvous point in the file
00044   /// system.
00045   ACE_SPIPE_Addr (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0);
00046 
00047   /// Acts like a copy constructor...
00048   int set (const ACE_SPIPE_Addr &sa);
00049 
00050   /// Create a ACE_SPIPE_Addr from a rendezvous point in the file
00051   /// system.
00052   int set (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0);
00053 
00054   /// Return a pointer to the address.
00055   virtual void *get_addr (void) const;
00056 
00057   /// Set a pointer to the underlying network address.
00058   virtual void set_addr (void *addr, int len);
00059 
00060   /// Transform the current address into string format.
00061   virtual int addr_to_string (ACE_TCHAR *addr, size_t) const;
00062 
00063   /// Transform the string into the current addressing format.
00064   virtual int string_to_addr (const ACE_TCHAR *addr);
00065 
00066   // = Equality/inequality tests
00067   /// Check for equality.
00068   int operator == (const ACE_SPIPE_Addr &SAP) const;
00069 
00070   /// Check for inequality
00071   int operator != (const ACE_SPIPE_Addr &SAP) const;
00072 
00073   // = SPIPE-specific address operations
00074   /// Pathname of rendezvous point in file system.
00075   const ACE_TCHAR *get_path_name (void) const;
00076 
00077   /// Get user id.
00078   uid_t user_id (void) const;
00079 
00080   /// Set user id.
00081   void user_id (uid_t uid);
00082 
00083   /// Set group ids.
00084   void group_id (gid_t gid);
00085 
00086   /// Get group ids.
00087   gid_t group_id (void) const;
00088 
00089   /// Dump the state of an object.
00090   void dump (void) const;
00091 
00092   /// Declare the dynamic allocation hooks.
00093   ACE_ALLOC_HOOK_DECLARE;
00094 
00095 private:
00096   /// Contains security attributes.
00097   struct SPIPE_Addr
00098   {
00099     /// Group id.
00100     gid_t gid_;
00101 
00102     /// User id.
00103     uid_t uid_;
00104 
00105     /// Pathname in the file system.
00106     ACE_TCHAR rendezvous_[MAXNAMLEN + 1];
00107 
00108   } SPIPE_addr_;
00109   // Contents of an SPIPE address.
00110 };
00111 
00112 #if defined (__ACE_INLINE__)
00113 #include "ace/SPIPE_Addr.i"
00114 #endif /* __ACE_INLINE__ */
00115 
00116 #include "ace/post.h"
00117 
00118 #endif /* ACE_SPIPE_ADDR_H */

Generated on Mon Jun 16 11:21:22 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002