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