Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
fxexdefs.h
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2004-2024 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
20
//
21
/****************************************************************************/
22
23
#ifndef FXEXDEFS_H
24
#define FXEXDEFS_H
25
26
#include <config.h>
27
28
#include "
fxheader.h
"
29
30
#ifdef WIN32
31
#define NOMINMAX
32
#include <windows.h>
33
#undef NOMINMAX
34
#endif
35
36
// loads the FOX defs
37
#ifndef FXDEFS_H
38
#include <fxdefs.h>
43
using namespace
FX
;
44
#endif
45
46
// implement CALLBACK for unix
47
#ifndef CALLBACK
48
#define CALLBACK
49
#endif
50
57
namespace
FXEX
{
58
59
// provide an extern mechanism
60
#ifdef WIN32
61
#ifdef FOXDLL
62
#ifndef FOXDLL_EXPORTS
63
#define FXEXTERN extern
64
#endif
65
#endif
66
#endif
67
68
#ifndef FXEXTERN
69
#define FXEXTERN
70
#endif
71
72
// Valid compression factors for Bzip and Gzip compression libraries
73
#define COMPRESS_MAX 9
74
#define COMPRESS_NORMAL 6
75
#define COMPRESS_FAST 1
76
#define COMPRESS_NONE 0
77
78
// Win32 defines INFINITE to be -1, we might as well do it too.
79
#ifndef WIN32
80
# define INFINITE (-1)
81
#endif
82
83
// determine the newline charater(s)
84
#ifdef WIN32
85
#define FXNEWLINE "\r\n"
86
#endif
87
#ifdef MAC
88
#define FXNEWLINE "\r"
89
#endif
90
#ifndef FXNEWLINE
91
#define FXNEWLINE "\n"
92
#endif
93
94
// make a short from two chars
95
#define MKUSHORT(l,h) ((((FX::FXuchar)(l))&0xff) | (((FX::FXuchar)(h))<<8))
96
97
/* !!!!
98
// Make a long from two ints - provided longs are twice the size of an int
99
#ifdef FX_LONG
100
# define MKULONG(l,h) ((((FX::FXuint)(l))&0xffffffff) | (((FX::FXuint)(h))<<32))
101
#else
102
# if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
103
# error "You wanted 64bit file sizes (actually 63), but I couldn't make it so..."
104
# endif
105
#endif
106
!!!! */
107
112
#define FXDeclare(Class) \
113
FXDECLARE(Class)
114
#define FXDeclareAbstract(Class) \
115
FXDECLARE_ABSTRACT(Class)
116
#define FXDefMap(Class) \
117
FXDEFMAP(Class) Class##Map[]
118
#define FXImplementAbstract(Class,Parent) \
119
FXIMPLEMENT_ABSTRACT(Class,Parent,Class##Map,ARRAYNUMBER(Class##Map))
120
#define FXImplement(Class,Parent) \
121
FXIMPLEMENT(Class,Parent,Class##Map,ARRAYNUMBER(Class##Map))
122
#define FXFuncDecl(Func) \
123
long on##Func (FXObject*,FXSelector,void*)
124
#define FXFuncImpl(Class,Func,tgt,sel,ptr) \
125
long Class::on##Func (FXOject *tgt,FXSelector sel, void *ptr)
126
#define FXMapTypes(Class,FromType,ToType,Func) \
127
FXMAPTYPES(SEL_##FromType,SEL_##ToType,Class::on##Func)
128
#define FXMapType(Class,SelType,Func) \
129
FXMAPTYPE(SEL_##SelType,Class::on##Func)
130
#define FXMapFuncs(Class,SelType,FromId,ToId,Func) \
131
FXMAPFUNCS(SEL_##SelType,Class::ID_##FromId,Class::ID_##ToId,Class::on#Func)
132
#define FXMapFunc(Class,SelType,Id,Func) \
133
FXMAPFUNC(SEL_##SelType,Class::ID_##Id,Class::on##Func)
134
136
#define FXSEND(tgt,sel,msg,ptr) \
137
(tgt->handle(this,FXSEL(sel,msg),ptr)
138
#define FXROUTE(src,tgt,sel,msg,ptr) \
139
(tgt->handle(src,FXSEL(sel,msg),ptr)
140
141
// debugging macros
142
#ifndef NDEBUG
143
# define FXCTOR() fxtrace (100,"%s::%s %p\n",getClassName(),getClassName(),this)
144
# define FXMETHOD(methodname) fxtrace (100,"%s::%s %p\n",getClassName(),#methodname,this)
145
# define FXDTOR() fxtrace (100,"%s::~%s %p\n",getClassName(),getClassName(),this)
146
#else
147
# define FXCTOR()
148
# define FXMETHOD(methodname)
149
# define FXDTOR()
150
#endif
151
152
// New selector types
153
enum
{
154
SEL_DATA
= FX::SEL_LAST,
// form of data as an event
155
SEL_THREAD
,
// thread/runnable events
156
SEL_WAITABLE_WAIT
,
// waitable event such as a Condition variable, semaphore, etc
157
SEL_WAITABLE_ACTIVATE
,
// waitable event such as a Condition variable, semaphore, etc
158
SEL_INTERLOCK
,
// interlocked event; object went into lock
159
SEL_BARRIER_LOCK
,
// barrier event; thread waiting in barrier lock
160
SEL_BARRIER_UNLOCK
,
// barrier event; barrier object reset, threads released
161
SEL_INPUT
,
// some type of input event
162
SEL_OUTPUT
,
// some type of output event
163
SEL_ERROR
,
// some type of error event
164
SEL_IO
,
// Some form of IO
165
SEL_IO_CONNECT
,
// Connection event
166
SEL_EVENT
,
// a generic event
167
SEL_BEGIN
,
// en event defining some begining
168
SEL_END
,
// an event defining some ending
169
SEL_TAG
,
// tag event
170
SEL_CONTENT
,
// content event
171
SEL_REGISTRY
,
// a registry event (TODO I have a plan for this...)
172
SEL_LASTEX
,
// Last message
173
SEL_THREAD_EVENT
174
};
175
177
typedef
FXint
FXIOStatus
;
178
enum
{
179
FXIOStatusUnknown
= -2,
180
FXIOStatusError
= -1,
181
FXIOStatusOk
= 0,
182
FXIOStatusOK
= 0,
183
FXIOStatusLast
184
};
185
#ifndef INVALID_HANDLE
186
#ifdef WIN32
187
#define INVALID_HANDLE INVALID_HANDLE_VALUE
188
#else
189
#define INVALID_HANDLE -1
190
#endif
191
#endif
192
193
#ifndef VALID_RESULT
194
#define VALID_RESULT 0
195
#endif
196
198
typedef
FXint
FXIOState
;
199
enum
{
200
FXIOStateUnknown
= -1,
201
FXIOStateNone
= -1,
202
FXIOStateOk
= 0,
203
FXIOStateOK
= 0,
204
FXIOStateUnconnected
,
205
FXIOStateConnected
,
206
FXIOStateOpen
=
FXIOStateConnected
,
207
FXIOStateListener
,
208
FXIOStateAccepted
,
209
FXIOStateDuplicated
,
210
FXIOStateLast
211
};
212
217
enum
FXSocketType
{
218
FXSocketTypeNone
= 0,
// unknown socket type
219
FXSocketTypeStream
,
// TCP socket
220
FXSocketTypeTCP
=
FXSocketTypeStream
,
// TCP socket
221
FXSocketTypeDatagram
,
// UDP socket
222
FXSocketTypeUDP
=
FXSocketTypeDatagram
// UDP socket
223
};
224
226
enum
FXSocketFamily
{
227
FXSocketFamilyNone
= 0,
// unknown socket family
228
FXSocketFamilyLocal
,
// Local domain socket (on nearly every system, same as Unix domain)
229
FXSocketFamilyInet
,
// Internet domain socket, version 4 (ie the default internet family)
230
FXSocketFamilyInet6
,
// Internet domain socket, version 6
231
FXSocketFamilyAutomatic
,
// automatically choose UNIX domain (local) socket, when connecting
232
// to localhost, internet domain for internet sockets
233
FXSocketFamilyUnix
=
FXSocketFamilyLocal
234
};
235
255
enum
FXFilePermission
{
256
FILEPERM_NONE
= 0,
// file has no permissions
257
FILEPERM_USER_READ
= 0x00000001,
// user can read from file
258
FILEPERM_USER_WRITE
= 0x00000002,
// user can write to file
259
FILEPERM_USER_EXEC
= 0X00000004,
// user can execute file
260
FILEPERM_GROUP_READ
= 0x00000010,
// group can read from file
261
FILEPERM_GROUP_WRITE
= 0x00000020,
// group can write to file
262
FILEPERM_GROUP_EXEC
= 0x00000040,
// group can execute the file
263
FILEPERM_OTHER_READ
= 0x00000100,
// everybody can read from file
264
FILEPERM_OTHER_WRITE
= 0x00000200,
// everybody can write to file
265
FILEPERM_OTHER_EXEC
= 0x00000400,
// everybody can execute the file
266
FILEPERM_READ
= 0x00000111,
// file read mask; set all read permissions
267
FILEPERM_WRITE
= 0x00000222,
// file write mask; set all write permissions
268
FILEPERM_EXEC
= 0x00000444,
// file execute mask; set all execute permissions
269
FILEPERM_ALL
= 0x00000777,
// permissions mask; set all permissions
270
FILEPERM_SET_UID
= 0x00001000,
// set the UID permission
271
FILEPERM_SET_GID
= 0x00002000,
// set the GID permisssion
272
FILEPERM_STICKY
= 0x00004000,
// set the STICKY permission
273
FILEPERM_SECURE_IO
=
FILEPERM_USER_READ
|
FILEPERM_USER_WRITE
,
// permissions suitable for single user IO access
274
FILEPERM_DEFAULT_IO
=
FILEPERM_READ
|
FILEPERM_USER_WRITE
|
FILEPERM_GROUP_WRITE
,
// permissions suitable for group IO access
275
FILEPERM_DEFAULT_EXEC
=
FILEPERM_READ
|
FILEPERM_USER_WRITE
|
FILEPERM_GROUP_WRITE
|
FILEPERM_EXEC
// permissions suitable for all users to execute a file
276
};
277
278
// thread stuff
279
#ifndef WIN32
280
typedef
void
*
FXThreadHandle
;
// handle to a thread
281
typedef
void
*
FXThreadMutex
;
// handle to a mutex
282
typedef
void
*
FXThreadCondition
;
// handle to a condition variable
283
typedef
void
*
FXThreadSemaphore
;
// handle to a semaphore
284
typedef
FXInputHandle*
MFXThreadEventHandle
;
// handle to a thread event object
285
#else
286
typedef
HANDLE
FXThreadHandle
;
// handle to a thread
287
typedef
HANDLE
FXThreadMutex
;
// handle to a mutex
288
typedef
HANDLE
FXThreadCondition
;
// handle to a condition variable
289
typedef
HANDLE
FXThreadSemaphore
;
// handle to a semaphore
290
typedef
FXInputHandle
MFXThreadEventHandle
;
// handle to a thread event object
291
#endif
292
293
// dynamic library loading
294
#ifndef WIN32
295
typedef
void
*
FXDLLHandle
;
// handle to a dynamically loaded file
296
#else
297
typedef
HMODULE
FXDLLHandle
;
// handle to a dynamically loaded file
298
#endif
299
300
namespace
FXUtils {
302
extern
FXAPI
const
FXuchar
fxexversion
[3];
303
}
304
}
// namespace FXEX
305
306
#endif
// FXEXDEFS_H
fxheader.h
FXEX::FXUtils::fxexversion
FXAPI const FXuchar fxexversion[3]
Version number that the library version is compiled with.
FXEX
Definition
fxexdefs.h:57
FXEX::FXDLLHandle
void * FXDLLHandle
Definition
fxexdefs.h:295
FXEX::FXIOStatus
FXint FXIOStatus
IO status definitions.
Definition
fxexdefs.h:177
FXEX::FXIOStateOK
@ FXIOStateOK
Definition
fxexdefs.h:203
FXEX::FXIOStateAccepted
@ FXIOStateAccepted
Definition
fxexdefs.h:208
FXEX::FXIOStateNone
@ FXIOStateNone
Definition
fxexdefs.h:201
FXEX::FXIOStateOk
@ FXIOStateOk
Definition
fxexdefs.h:202
FXEX::FXIOStateConnected
@ FXIOStateConnected
Definition
fxexdefs.h:205
FXEX::FXIOStateDuplicated
@ FXIOStateDuplicated
Definition
fxexdefs.h:209
FXEX::FXIOStateListener
@ FXIOStateListener
Definition
fxexdefs.h:207
FXEX::FXIOStateLast
@ FXIOStateLast
Definition
fxexdefs.h:210
FXEX::FXIOStateUnconnected
@ FXIOStateUnconnected
Definition
fxexdefs.h:204
FXEX::FXIOStateUnknown
@ FXIOStateUnknown
Definition
fxexdefs.h:200
FXEX::FXIOStateOpen
@ FXIOStateOpen
Definition
fxexdefs.h:206
FXEX::SEL_REGISTRY
@ SEL_REGISTRY
Definition
fxexdefs.h:171
FXEX::SEL_CONTENT
@ SEL_CONTENT
Definition
fxexdefs.h:170
FXEX::SEL_BARRIER_LOCK
@ SEL_BARRIER_LOCK
Definition
fxexdefs.h:159
FXEX::SEL_OUTPUT
@ SEL_OUTPUT
Definition
fxexdefs.h:162
FXEX::SEL_END
@ SEL_END
Definition
fxexdefs.h:168
FXEX::SEL_EVENT
@ SEL_EVENT
Definition
fxexdefs.h:166
FXEX::SEL_WAITABLE_ACTIVATE
@ SEL_WAITABLE_ACTIVATE
Definition
fxexdefs.h:157
FXEX::SEL_INTERLOCK
@ SEL_INTERLOCK
Definition
fxexdefs.h:158
FXEX::SEL_INPUT
@ SEL_INPUT
Definition
fxexdefs.h:161
FXEX::SEL_BEGIN
@ SEL_BEGIN
Definition
fxexdefs.h:167
FXEX::SEL_WAITABLE_WAIT
@ SEL_WAITABLE_WAIT
Definition
fxexdefs.h:156
FXEX::SEL_LASTEX
@ SEL_LASTEX
Definition
fxexdefs.h:172
FXEX::SEL_IO_CONNECT
@ SEL_IO_CONNECT
Definition
fxexdefs.h:165
FXEX::SEL_THREAD_EVENT
@ SEL_THREAD_EVENT
Definition
fxexdefs.h:173
FXEX::SEL_DATA
@ SEL_DATA
Definition
fxexdefs.h:154
FXEX::SEL_IO
@ SEL_IO
Definition
fxexdefs.h:164
FXEX::SEL_BARRIER_UNLOCK
@ SEL_BARRIER_UNLOCK
Definition
fxexdefs.h:160
FXEX::SEL_TAG
@ SEL_TAG
Definition
fxexdefs.h:169
FXEX::SEL_ERROR
@ SEL_ERROR
Definition
fxexdefs.h:163
FXEX::SEL_THREAD
@ SEL_THREAD
Definition
fxexdefs.h:155
FXEX::FXThreadHandle
void * FXThreadHandle
Definition
fxexdefs.h:280
FXEX::FXThreadMutex
void * FXThreadMutex
Definition
fxexdefs.h:281
FXEX::MFXThreadEventHandle
FXInputHandle * MFXThreadEventHandle
Definition
fxexdefs.h:284
FXEX::FXIOState
FXint FXIOState
IO state definitions.
Definition
fxexdefs.h:198
FXEX::FXThreadSemaphore
void * FXThreadSemaphore
Definition
fxexdefs.h:283
FXEX::FXSocketType
FXSocketType
Socket types.
Definition
fxexdefs.h:217
FXEX::FXSocketTypeTCP
@ FXSocketTypeTCP
Definition
fxexdefs.h:220
FXEX::FXSocketTypeUDP
@ FXSocketTypeUDP
Definition
fxexdefs.h:222
FXEX::FXSocketTypeDatagram
@ FXSocketTypeDatagram
Definition
fxexdefs.h:221
FXEX::FXSocketTypeStream
@ FXSocketTypeStream
Definition
fxexdefs.h:219
FXEX::FXSocketTypeNone
@ FXSocketTypeNone
Definition
fxexdefs.h:218
FXEX::FXThreadCondition
void * FXThreadCondition
Definition
fxexdefs.h:282
FXEX::FXSocketFamily
FXSocketFamily
Socket families.
Definition
fxexdefs.h:226
FXEX::FXSocketFamilyNone
@ FXSocketFamilyNone
Definition
fxexdefs.h:227
FXEX::FXSocketFamilyUnix
@ FXSocketFamilyUnix
Definition
fxexdefs.h:233
FXEX::FXSocketFamilyAutomatic
@ FXSocketFamilyAutomatic
Definition
fxexdefs.h:231
FXEX::FXSocketFamilyInet6
@ FXSocketFamilyInet6
Definition
fxexdefs.h:230
FXEX::FXSocketFamilyLocal
@ FXSocketFamilyLocal
Definition
fxexdefs.h:228
FXEX::FXSocketFamilyInet
@ FXSocketFamilyInet
Definition
fxexdefs.h:229
FXEX::FXIOStatusOk
@ FXIOStatusOk
Definition
fxexdefs.h:181
FXEX::FXIOStatusUnknown
@ FXIOStatusUnknown
Definition
fxexdefs.h:179
FXEX::FXIOStatusLast
@ FXIOStatusLast
Definition
fxexdefs.h:183
FXEX::FXIOStatusError
@ FXIOStatusError
Definition
fxexdefs.h:180
FXEX::FXIOStatusOK
@ FXIOStatusOK
Definition
fxexdefs.h:182
FXEX::FXFilePermission
FXFilePermission
Definition
fxexdefs.h:255
FXEX::FILEPERM_GROUP_READ
@ FILEPERM_GROUP_READ
Definition
fxexdefs.h:260
FXEX::FILEPERM_NONE
@ FILEPERM_NONE
Definition
fxexdefs.h:256
FXEX::FILEPERM_OTHER_WRITE
@ FILEPERM_OTHER_WRITE
Definition
fxexdefs.h:264
FXEX::FILEPERM_READ
@ FILEPERM_READ
Definition
fxexdefs.h:266
FXEX::FILEPERM_USER_READ
@ FILEPERM_USER_READ
Definition
fxexdefs.h:257
FXEX::FILEPERM_OTHER_EXEC
@ FILEPERM_OTHER_EXEC
Definition
fxexdefs.h:265
FXEX::FILEPERM_GROUP_EXEC
@ FILEPERM_GROUP_EXEC
Definition
fxexdefs.h:262
FXEX::FILEPERM_USER_WRITE
@ FILEPERM_USER_WRITE
Definition
fxexdefs.h:258
FXEX::FILEPERM_STICKY
@ FILEPERM_STICKY
Definition
fxexdefs.h:272
FXEX::FILEPERM_ALL
@ FILEPERM_ALL
Definition
fxexdefs.h:269
FXEX::FILEPERM_EXEC
@ FILEPERM_EXEC
Definition
fxexdefs.h:268
FXEX::FILEPERM_OTHER_READ
@ FILEPERM_OTHER_READ
Definition
fxexdefs.h:263
FXEX::FILEPERM_WRITE
@ FILEPERM_WRITE
Definition
fxexdefs.h:267
FXEX::FILEPERM_DEFAULT_IO
@ FILEPERM_DEFAULT_IO
Definition
fxexdefs.h:274
FXEX::FILEPERM_SECURE_IO
@ FILEPERM_SECURE_IO
Definition
fxexdefs.h:273
FXEX::FILEPERM_SET_GID
@ FILEPERM_SET_GID
Definition
fxexdefs.h:271
FXEX::FILEPERM_SET_UID
@ FILEPERM_SET_UID
Definition
fxexdefs.h:270
FXEX::FILEPERM_DEFAULT_EXEC
@ FILEPERM_DEFAULT_EXEC
Definition
fxexdefs.h:275
FXEX::FILEPERM_GROUP_WRITE
@ FILEPERM_GROUP_WRITE
Definition
fxexdefs.h:261
FXEX::FILEPERM_USER_EXEC
@ FILEPERM_USER_EXEC
Definition
fxexdefs.h:259
FX
Definition
GUI.h:31
src
utils
foxtools
fxexdefs.h
Generated on Fri Nov 22 2024 00:15:37 for Eclipse SUMO - Simulation of Urban MObility by
1.9.8