ATM_Params.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    ATM_Params.h
00006  *
00007  *  ATM_Params.h,v 4.15 2005/10/28 16:14:51 ossama 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 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00053 
00054 /**
00055  * @class ACE_ATM_Params
00056  *
00057  * @brief Wrapper class that simplifies the information passed to the ATM
00058  * enabled ACE_ATM_Connector class.
00059  */
00060 class ACE_Export ACE_ATM_Params
00061 {
00062 public:
00063   /**
00064    * Initialize the data members.  This class combines options from
00065    * ACE_SOCK_Connector (<protocol_family>, <protocol>, <type>,
00066    * <protocol_info>, <group>, and <flags>) and
00067    * ACE_TLI_Connector (<device>, <info>, <rw_flag>, <oflag>, and <udata>)
00068    * so that either mechanism can be used transparently for ATM.
00069    */
00070   ACE_ATM_Params (int rw_flag = 1,
00071                   const char device[] = ACE_XTI_ATM_DEVICE,
00072                   Param_Info *info = 0,
00073                   Param_Udata *udata = 0,
00074                   int oflag = O_RDWR,
00075                   int protocol_family = AF_ATM,
00076                   int protocol = ATM_PROTOCOL_DEFAULT,
00077                   int type =
00078 #if defined (ACE_HAS_LINUX_ATM)
00079                   SOCK_DGRAM,
00080 #else
00081                   SOCK_RAW,
00082 #endif /* ACE_HAS_LINUX_ATM */
00083                   ACE_Protocol_Info *protocol_info = 0,
00084                   ACE_SOCK_GROUP g = 0,
00085                   u_long flags
00086                     = ACE_FLAG_MULTIPOINT_C_ROOT
00087                     | ACE_FLAG_MULTIPOINT_D_ROOT, // connector by default
00088                   int reuse_addr = 0);
00089 
00090   /// Destructor.
00091   ~ACE_ATM_Params ();
00092 
00093   /// Get protocol family.
00094   int get_protocol_family (void) const;
00095 
00096   /// Set protocol family.
00097   void set_protocol_family (int);
00098 
00099   /// Get protocol.
00100   int get_protocol (void) const;
00101 
00102   /// Set protocol.
00103   void set_protocol (int);
00104 
00105   /// Get type.
00106   int get_type (void) const;
00107 
00108   /// Set type.
00109   void set_type (int);
00110 
00111   /// Get protocol info.
00112   ACE_Protocol_Info *get_protocol_info( void );
00113 
00114   /// Set protocol info.
00115   void set_protocol_info( ACE_Protocol_Info *);
00116 
00117   /// Get socket group.
00118   ACE_SOCK_GROUP get_sock_group( void );
00119 
00120   /// Set socket group.
00121   void set_sock_group( ACE_SOCK_GROUP );
00122 
00123   /// Get socket flags.
00124   u_long get_flags( void );
00125 
00126   /// Set socket flags.
00127   void set_flags( u_long );
00128 
00129   /// Get reuse_addr flag.
00130   int get_reuse_addr (void) const;
00131 
00132   /// Set reuse_addr flag.
00133   void set_reuse_addr (int);
00134 
00135   /// Get device.
00136   const char* get_device (void) const;
00137 
00138   /// Get info.
00139   Param_Info* get_info (void) const;
00140 
00141   /// Set info.
00142   void set_info (Param_Info *);
00143 
00144   /// Get r/w flag.
00145   int get_rw_flag (void) const;
00146 
00147   /// Set r/w flag.
00148   void set_rw_flag (int);
00149 
00150   /// Get user data.
00151   Param_Udata* get_user_data (void) const;
00152 
00153   /// Set user data.
00154   void set_user_data (Param_Udata*);
00155 
00156   /// Get open flag.
00157   int get_oflag (void) const;
00158 
00159   /// Set open flag.
00160   void set_oflag (int);
00161 
00162   /// Dump the state of an object.
00163   void dump (void) const;
00164 
00165   /// Declare the dynamic allocation hooks.
00166   ACE_ALLOC_HOOK_DECLARE;
00167 
00168 private:
00169   /// Protocol family for sockets connections.
00170   int protocol_family_;
00171 
00172   /// Protocol for sockets connections.
00173   int protocol_;
00174 
00175   /// Type for opening sockets.
00176   int type_;
00177 
00178   /// Information about the protocol.
00179   ACE_Protocol_Info *protocol_info_;
00180 
00181   /// Socket group used (for sockets only).
00182   ACE_SOCK_GROUP group_;
00183 
00184   /// Flags for sockets (for sockets only).
00185   u_long flags_;
00186 
00187   /// Flag for reusing address for opening sockets.
00188   int reuse_addr_;
00189 
00190   /// Device name for XTI/ATM connections.
00191   const char *device_;
00192 
00193   /// Info for XTI/ATM connections.
00194   Param_Info *info_;
00195 
00196   /// R/W flag for XTI/ATM connections.
00197   int rw_flag_;
00198 
00199   /// User data for XTI/ATM connections.
00200   Param_Udata *udata_;
00201 
00202   /// Open flag for XTI/ATM connections.
00203   int oflag_;
00204 };
00205 
00206 ACE_END_VERSIONED_NAMESPACE_DECL
00207 
00208 #if defined (__ACE_INLINE__)
00209 #include "ace/ATM_Params.inl"
00210 #endif /* __ACE_INLINE__ */
00211 
00212 #endif /* ACE_HAS_ATM */
00213 #include /**/ "ace/post.h"
00214 #endif /* ACE_ATM_PARAMS_H */

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