[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / dep / ACE_wrappers / ace / ATM_Params.h
blobd1e8c9231185ab61237f8bc07e850f58ad8a4c1b
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file ATM_Params.h
7 * $Id: ATM_Params.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Joe Hoffert <joeh@cs.wustl.edu>
11 //==========================================================================
14 #ifndef ACE_ATM_PARAMS_H
15 #define ACE_ATM_PARAMS_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #if defined (ACE_HAS_ATM)
26 #include /**/ "ace/ACE_export.h"
28 #if defined (ACE_HAS_FORE_ATM_XTI)
29 #include "ace/TLI.h"
30 #define ATM_PROTOCOL_DEFAULT 0
31 typedef struct t_info Param_Info;
32 typedef struct netbuf Param_Udata;
33 #elif defined (ACE_HAS_FORE_ATM_WS2)
34 #include "ace/SOCK.h"
35 #define ATM_PROTOCOL_DEFAULT ATMPROTO_AAL5
36 #define ACE_XTI_ATM_DEVICE ""
37 typedef int Param_Info;
38 typedef int Param_Udata;
39 #elif defined (ACE_HAS_LINUX_ATM)
40 #include /**/ "atm.h"
41 #define AF_ATM PF_ATMSVC
42 #define ACE_XTI_ATM_DEVICE ""
43 #define ATM_PROTOCOL_DEFAULT ATM_AAL5
44 typedef int Param_Info;
45 typedef int Param_Udata;
46 #else
47 #define ACE_XTI_ATM_DEVICE ""
48 typedef int Param_Info;
49 typedef int Param_Udata;
50 #endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 || ACE_HAS_LINUX_ATM */
52 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
54 /**
55 * @class ACE_ATM_Params
57 * @brief Wrapper class that simplifies the information passed to the ATM
58 * enabled ACE_ATM_Connector class.
60 class ACE_Export ACE_ATM_Params
62 public:
63 /**
64 * Initialize the data members. This class combines options from
65 * ACE_SOCK_Connector (@a protocol_family, @a protocol, <type>,
66 * @a protocol_info, <group>, and @a flags) and
67 * ACE_TLI_Connector (<device>, <info>, <rw_flag>, <oflag>, and <udata>)
68 * so that either mechanism can be used transparently for ATM.
70 ACE_ATM_Params (int rw_flag = 1,
71 const char device[] = ACE_XTI_ATM_DEVICE,
72 Param_Info *info = 0,
73 Param_Udata *udata = 0,
74 int oflag = O_RDWR,
75 int protocol_family = AF_ATM,
76 int protocol = ATM_PROTOCOL_DEFAULT,
77 int type =
78 #if defined (ACE_HAS_LINUX_ATM)
79 SOCK_DGRAM,
80 #else
81 SOCK_RAW,
82 #endif /* ACE_HAS_LINUX_ATM */
83 ACE_Protocol_Info *protocol_info = 0,
84 ACE_SOCK_GROUP g = 0,
85 u_long flags
86 = ACE_FLAG_MULTIPOINT_C_ROOT
87 | ACE_FLAG_MULTIPOINT_D_ROOT, // connector by default
88 int reuse_addr = 0);
90 /// Destructor.
91 ~ACE_ATM_Params ();
93 /// Get protocol family.
94 int get_protocol_family (void) const;
96 /// Set protocol family.
97 void set_protocol_family (int);
99 /// Get protocol.
100 int get_protocol (void) const;
102 /// Set protocol.
103 void set_protocol (int);
105 /// Get type.
106 int get_type (void) const;
108 /// Set type.
109 void set_type (int);
111 /// Get protocol info.
112 ACE_Protocol_Info *get_protocol_info( void );
114 /// Set protocol info.
115 void set_protocol_info( ACE_Protocol_Info *);
117 /// Get socket group.
118 ACE_SOCK_GROUP get_sock_group( void );
120 /// Set socket group.
121 void set_sock_group( ACE_SOCK_GROUP );
123 /// Get socket flags.
124 u_long get_flags( void );
126 /// Set socket flags.
127 void set_flags( u_long );
129 /// Get reuse_addr flag.
130 int get_reuse_addr (void) const;
132 /// Set reuse_addr flag.
133 void set_reuse_addr (int);
135 /// Get device.
136 const char* get_device (void) const;
138 /// Get info.
139 Param_Info* get_info (void) const;
141 /// Set info.
142 void set_info (Param_Info *);
144 /// Get r/w flag.
145 int get_rw_flag (void) const;
147 /// Set r/w flag.
148 void set_rw_flag (int);
150 /// Get user data.
151 Param_Udata* get_user_data (void) const;
153 /// Set user data.
154 void set_user_data (Param_Udata*);
156 /// Get open flag.
157 int get_oflag (void) const;
159 /// Set open flag.
160 void set_oflag (int);
162 /// Dump the state of an object.
163 void dump (void) const;
165 /// Declare the dynamic allocation hooks.
166 ACE_ALLOC_HOOK_DECLARE;
168 private:
169 /// Protocol family for sockets connections.
170 int protocol_family_;
172 /// Protocol for sockets connections.
173 int protocol_;
175 /// Type for opening sockets.
176 int type_;
178 /// Information about the protocol.
179 ACE_Protocol_Info *protocol_info_;
181 /// Socket group used (for sockets only).
182 ACE_SOCK_GROUP group_;
184 /// Flags for sockets (for sockets only).
185 u_long flags_;
187 /// Flag for reusing address for opening sockets.
188 int reuse_addr_;
190 /// Device name for XTI/ATM connections.
191 const char *device_;
193 /// Info for XTI/ATM connections.
194 Param_Info *info_;
196 /// R/W flag for XTI/ATM connections.
197 int rw_flag_;
199 /// User data for XTI/ATM connections.
200 Param_Udata *udata_;
202 /// Open flag for XTI/ATM connections.
203 int oflag_;
206 ACE_END_VERSIONED_NAMESPACE_DECL
208 #if defined (__ACE_INLINE__)
209 #include "ace/ATM_Params.inl"
210 #endif /* __ACE_INLINE__ */
212 #endif /* ACE_HAS_ATM */
213 #include /**/ "ace/post.h"
214 #endif /* ACE_ATM_PARAMS_H */