Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

vprDomain.h

Go to the documentation of this file.
00001 /****************** <VPR heading BEGIN do not edit this line> *****************
00002  *
00003  * VR Juggler Portable Runtime
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Patrick Hartling, Kevin Meinert, Carolina Cruz-Neira
00007  *
00008  * -----------------------------------------------------------------
00009  * File:          $RCSfile: vprDomain.h,v $
00010  * Date modified: $Date: 2003/09/23 21:33:55 $
00011  * Version:       $Revision: 1.16 $
00012  * -----------------------------------------------------------------
00013  *
00014  ****************** <VPR heading END do not edit this line> ******************/
00015 
00016 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00017  *
00018  * VR Juggler is (C) Copyright 1998-2003 by Iowa State University
00019  *
00020  * Original Authors:
00021  *   Allen Bierbaum, Christopher Just,
00022  *   Patrick Hartling, Kevin Meinert,
00023  *   Carolina Cruz-Neira, Albert Baker
00024  *
00025  * This library is free software; you can redistribute it and/or
00026  * modify it under the terms of the GNU Library General Public
00027  * License as published by the Free Software Foundation; either
00028  * version 2 of the License, or (at your option) any later version.
00029  *
00030  * This library is distributed in the hope that it will be useful,
00031  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00032  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00033  * Library General Public License for more details.
00034  *
00035  * You should have received a copy of the GNU Library General Public
00036  * License along with this library; if not, write to the
00037  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00038  * Boston, MA 02111-1307, USA.
00039  *
00040  *************** <auto-copyright.pl END do not edit this line> ***************/
00041 
00042 #ifndef _VPR_DOMAIN_H_
00043 #define _VPR_DOMAIN_H_
00044 
00045 // The following define "domains" supported by VPR.  These are used to
00046 // determine which platform specific headers should be included when
00047 // compiling.  See vpr/Thread/Thread.h for an example of these values are
00048 // used with the domain settings defined below.
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 // This is the VPR I/O domain.  It defines all the platform-independent types
00056 // used for doing I/O (sockets and serial ports mostly) in VPR.
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    /* Don't allow serial ports in simulator for now.
00081    * This is because IOSys is of the wrong type and there is
00082    * not an easy fix for this right now.
00083    */
00084 
00085 //#  ifdef VPR_OS_Win32
00086 //      typedef SerialPort_t<class SerialPortImplWin32>   SerialPort;
00087 //#  else
00088 //      typedef SerialPort_t<class SerialPortImplTermios> SerialPort;
00089 //#  endif  /* VPR_OS_Win32 */
00090 
00091 #else /* ! ifdef VPR_SIMULATOR */
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  /* VPR_OS_Win32 */
00130 
00131 /* POSIX and SPROC */
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 /* ifdef VPR_USE_NSPR */
00150 #endif /* ifdef VPR_SIMULATOR */
00151 
00152 }
00153 
00154 // This is the threading (and synchronization) domain.  It defins the types
00155 // used for platform-independent constructs for doing multi-threaded
00156 // programming.
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 /* POSIX and SPROC */
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 /* ifdef VPR_USE_IRIX_SPROC */
00199 
00200 #endif /* ifdef VPR_USE_NSPR */
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  /* ifndef _VPR_DOMAIN_H_ */

Generated on Sun May 2 14:43:03 2004 for VR Juggler Portable Runtime by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002