00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef _VPR_DOMAIN_H_
00043 #define _VPR_DOMAIN_H_
00044
00045
00046
00047
00048
00049 #define VPR_DOMAIN_NONE 0
00050 #define VPR_DOMAIN_NSPR 1
00051 #define VPR_DOMAIN_POSIX 2
00052 #define VPR_DOMAIN_IRIX_SPROC 3
00053 #define VPR_DOMAIN_SIMULATOR 4
00054
00055
00056
00057 namespace vpr
00058 {
00059 template<class> class Selector_t;
00060 template<class> class SerialPort_t;
00061
00062 template<class BASE_ONE, class BASE_TWO> class IOStatsStrategyAdapter;
00063
00064 #ifdef VPR_SIMULATOR
00065 # define VPR_IO_DOMAIN_INCLUDE VPR_DOMAIN_SIMULATOR
00066
00067 struct SocketConfiguration
00068 {
00069 typedef class SocketImplSIM SocketImpl;
00070 typedef class SocketDatagramImplSIM SocketDatagramImpl;
00071 typedef class SocketStreamImplSIM SocketStreamImpl;
00072 typedef class IOStatsStrategyAdapter<class BaseIOStatsStrategy, class BandwidthIOStatsStrategy> SocketIOStatsStrategy;
00073 };
00074
00075 typedef class InetAddrSIM InetAddr;
00076 typedef class IOSysSIM IOSys;
00077
00078 typedef class Selector_t<class SelectorImplSIM> Selector;
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 #else
00092
00093 #ifdef VPR_USE_NSPR
00094 # define VPR_IO_DOMAIN_INCLUDE VPR_DOMAIN_NSPR
00095
00096 struct SocketConfiguration
00097 {
00098 typedef class SocketImplNSPR SocketImpl;
00099 typedef class SocketDatagramImplNSPR SocketDatagramImpl;
00100 typedef class SocketStreamImplNSPR SocketStreamImpl;
00101
00102 #ifdef __SUNPRO_CC
00103 class BaseIOStatsStrategy;
00104 class BandwidthIOStatsStrategy;
00105 class IOStatsStrategyAdapter<class T1, class T2>;
00106
00107 typedef IOStatsStrategyAdapter<BaseIOStatsStrategy, BandwidthIOStatsStrategy> SocketIOStatsStrategy;
00108 #else
00109 typedef class IOStatsStrategyAdapter<class BaseIOStatsStrategy, class BandwidthIOStatsStrategy> SocketIOStatsStrategy;
00110 #endif
00111 };
00112
00113 typedef class InetAddrNSPR InetAddr;
00114 typedef class IOSysNSPR IOSys;
00115
00116 #ifdef __SUNPRO_CC
00117 class Selector_t<class T>;
00118 class SelectorImplNSPR;
00119
00120 typedef Selector_t<SelectorImplNSPR> Selector;
00121 #else
00122 typedef class Selector_t<class SelectorImplNSPR> Selector;
00123 #endif
00124
00125 # ifdef VPR_OS_Win32
00126 typedef SerialPort_t<class SerialPortImplWin32> SerialPort;
00127 # else
00128 typedef SerialPort_t<class SerialPortImplTermios> SerialPort;
00129 # endif
00130
00131
00132 #else
00133 # define VPR_IO_DOMAIN_INCLUDE VPR_DOMAIN_POSIX
00134
00135 struct SocketConfiguration
00136 {
00137 typedef class SocketImplBSD SocketImpl;
00138 typedef class SocketDatagramImplBSD SocketDatagramImpl;
00139 typedef class SocketStreamImplBSD SocketStreamImpl;
00140 typedef IOStatsStrategyAdapter<class BaseIOStatsStrategy, class BandwidthIOStatsStrategy> SocketIOStatsStrategy;
00141 };
00142
00143 typedef class InetAddrBSD InetAddr;
00144 typedef class IOSysUnix IOSys;
00145
00146 typedef class Selector_t<class SelectorImplBSD> Selector;
00147 typedef class SerialPort_t<class SerialPortImplTermios> SerialPort;
00148
00149 #endif
00150 #endif
00151
00152 }
00153
00154
00155
00156
00157 namespace vpr
00158 {
00159 #ifdef VPR_USE_NSPR
00160 # define VPR_THREAD_DOMAIN_INCLUDE VPR_DOMAIN_NSPR
00161
00162 typedef class ErrorImplNSPR Error;
00163 typedef class SystemNSPR System;
00164 typedef class CondVarNSPR CondVar;
00165 typedef class MutexNSPR Mutex;
00166 typedef class RWMutexNSPR RWMutex;
00167 typedef class SemaphoreNSPR Semaphore;
00168 typedef class ThreadNSPR Thread;
00169 typedef class ThreadKeyNSPR KeyId;
00170
00171
00172 #else
00173 typedef class ErrorImplPosix Error;
00174 typedef class SystemPosix System;
00175
00176 # ifdef VPR_USE_IRIX_SPROC
00177 # define VPR_THREAD_DOMAIN_INCLUDE VPR_DOMAIN_IRIX_SPROC
00178
00179 typedef class BarrierSGI Barrier;
00180 typedef class CondVarGeneric CondVar;
00181 typedef class MutexSGI Mutex;
00182 typedef class SemaphoreSGI Semaphore;
00183
00184 typedef struct cancel_state cancel_state_t;
00185 typedef class ThreadSGI Thread;
00186 typedef class ThreadKeySGI KeyId;
00187 # else
00188 # define VPR_THREAD_DOMAIN_INCLUDE VPR_DOMAIN_POSIX
00189
00190 typedef class CondVarPosix CondVar;
00191 typedef class MutexPosix Mutex;
00192 typedef class RWMutexPosix RWMutex;
00193 typedef class SemaphorePosix Semaphore;
00194
00195 typedef int cancel_state_t;
00196 typedef class ThreadPosix Thread;
00197 typedef class ThreadKeyPosix KeyId;
00198 # endif
00199
00200 #endif
00201 }
00202
00203 #ifndef VPR_IO_DOMAIN_INCLUDE
00204 #define VPR_IO_DOMAIN_INCLUDE VPR_DOMAIN_NONE
00205 #endif
00206
00207 #ifndef VPR_THREAD_DOMAIN_INCLUDE
00208 #define VPR_THREAD_DOMAIN_INCLUDE VPR_DOMAIN_NONE
00209 #endif
00210
00211 #endif