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

ATM_Params.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    ATM_Params.h
00006  *
00007  *  $Id: ATM_Params.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Joe Hoffert <joeh@cs.wustl.edu>
00010  */
00011 //==========================================================================
00012 
00013 
00014 #ifndef ACE_ATM_PARAMS_H
00015 #define ACE_ATM_PARAMS_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/config-all.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #if defined (ACE_HAS_ATM)
00025 
00026 #include "ace/ACE_export.h"
00027 
00028 #if defined (ACE_HAS_FORE_ATM_XTI)
00029 #include "ace/TLI.h"
00030 #define ATM_PROTOCOL_DEFAULT 0
00031 typedef struct t_info Param_Info;
00032 typedef struct netbuf Param_Udata;
00033 #elif defined (ACE_HAS_FORE_ATM_WS2)
00034 #include "ace/SOCK.h"
00035 #define ATM_PROTOCOL_DEFAULT ATMPROTO_AAL5
00036 #define ACE_XTI_ATM_DEVICE ""
00037 typedef int Param_Info;
00038 typedef int Param_Udata;
00039 #elif defined (ACE_HAS_LINUX_ATM)
00040 #include /**/ "atm.h"
00041 #define AF_ATM PF_ATMSVC
00042 #define ACE_XTI_ATM_DEVICE ""
00043 #define ATM_PROTOCOL_DEFAULT ATM_AAL5
00044 typedef int Param_Info;
00045 typedef int Param_Udata;
00046 #else
00047 #define ACE_XTI_ATM_DEVICE ""
00048 typedef int Param_Info;
00049 typedef int Param_Udata;
00050 #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */
00051 
00052 /**
00053  * @class ACE_ATM_Params
00054  *
00055  * @brief Wrapper class that simplifies the information passed to the ATM
00056  * enabled ACE_ATM_Connector class.
00057  */
00058 class ACE_Export ACE_ATM_Params
00059 {
00060 public:
00061   /**
00062    * Initialize the data members.  This class combines options from
00063    * ACE_SOCK_Connector (<protocol_family>, <protocol>, <type>,
00064    * <protocol_info>, <group>, and <flags>) and
00065    * ACE_TLI_Connector (<device>, <info>, <rw_flag>, <oflag>, and <udata>)
00066    * so that either mechanism can be used transparently for ATM.
00067    */
00068   ACE_ATM_Params (int rw_flag = 1,
00069                   const char device[] = ACE_XTI_ATM_DEVICE,
00070                   Param_Info *info = 0,
00071                   Param_Udata *udata = 0,
00072                   int oflag = O_RDWR,
00073                   int protocol_family = AF_ATM,
00074                   int protocol = ATM_PROTOCOL_DEFAULT,
00075                   int type =
00076 #if defined (ACE_HAS_LINUX_ATM)
00077                   SOCK_DGRAM,
00078 #else
00079                   SOCK_RAW,
00080 #endif /* ACE_HAS_LINUX_ATM */
00081                   ACE_Protocol_Info *protocol_info = 0,
00082                   ACE_SOCK_GROUP g = 0,
00083                   u_long flags
00084                     = ACE_FLAG_MULTIPOINT_C_ROOT
00085                     | ACE_FLAG_MULTIPOINT_D_ROOT, // connector by default
00086                   int reuse_addr = 0);
00087 
00088   /// Destructor.
00089   ~ACE_ATM_Params ();
00090 
00091   /// Get protocol family.
00092   int get_protocol_family (void) const;
00093 
00094   /// Set protocol family.
00095   void set_protocol_family (int);
00096 
00097   /// Get protocol.
00098   int get_protocol (void) const;
00099 
00100   /// Set protocol.
00101   void set_protocol (int);
00102 
00103   /// Get type.
00104   int get_type (void) const;
00105 
00106   /// Set type.
00107   void set_type (int);
00108 
00109   /// Get protocol info.
00110   ACE_Protocol_Info *get_protocol_info( void );
00111 
00112   /// Set protocol info.
00113   void set_protocol_info( ACE_Protocol_Info *);
00114 
00115   /// Get socket group.
00116   ACE_SOCK_GROUP get_sock_group( void );
00117 
00118   /// Set socket group.
00119   void set_sock_group( ACE_SOCK_GROUP );
00120 
00121   /// Get socket flags.
00122   u_long get_flags( void );
00123 
00124   /// Set socket flags.
00125   void set_flags( u_long );
00126 
00127   /// Get reuse_addr flag.
00128   int get_reuse_addr (void) const;
00129 
00130   /// Set reuse_addr flag.
00131   void set_reuse_addr (int);
00132 
00133   /// Get device.
00134   const char* get_device (void) const;
00135 
00136   /// Get info.
00137   Param_Info* get_info (void) const;
00138 
00139   /// Set info.
00140   void set_info (Param_Info *);
00141 
00142   /// Get r/w flag.
00143   int get_rw_flag (void) const;
00144 
00145   /// Set r/w flag.
00146   void set_rw_flag (int);
00147 
00148   /// Get user data.
00149   Param_Udata* get_user_data (void) const;
00150 
00151   /// Set user data.
00152   void set_user_data (Param_Udata*);
00153 
00154   /// Get open flag.
00155   int get_oflag (void) const;
00156 
00157   /// Set open flag.
00158   void set_oflag (int);
00159 
00160   /// Dump the state of an object.
00161   void dump (void) const;
00162 
00163   /// Declare the dynamic allocation hooks.
00164   ACE_ALLOC_HOOK_DECLARE;
00165 
00166 private:
00167   /// Protocol family for sockets connections.
00168   int protocol_family_;
00169 
00170   /// Protocol for sockets connections.
00171   int protocol_;
00172 
00173   /// Type for opening sockets.
00174   int type_;
00175 
00176   /// Information about the protocol.
00177   ACE_Protocol_Info *protocol_info_;
00178 
00179   /// Socket group used (for sockets only).
00180   ACE_SOCK_GROUP group_;
00181 
00182   /// Flags for sockets (for sockets only).
00183   u_long flags_;
00184 
00185   /// Flag for reusing address for opening sockets.
00186   int reuse_addr_;
00187 
00188   /// Device name for XTI/ATM connections.
00189   const char *device_;
00190 
00191   /// Info for XTI/ATM connections.
00192   Param_Info *info_;
00193 
00194   /// R/W flag for XTI/ATM connections.
00195   int rw_flag_;
00196 
00197   /// User data for XTI/ATM connections.
00198   Param_Udata *udata_;
00199 
00200   /// Open flag for XTI/ATM connections.
00201   int oflag_;
00202 };
00203 
00204 #if defined (__ACE_INLINE__)
00205 #include "ace/ATM_Params.i"
00206 #endif /* __ACE_INLINE__ */
00207 
00208 #endif /* ACE_HAS_ATM */
00209 #include "ace/post.h"
00210 #endif /* ACE_ATM_PARAMS_H */

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