Back to index

lightning-sunbird  0.9+nobinonly
GUSINull.h
Go to the documentation of this file.
00001 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00002 // % Project  :      GUSI                        -      Grand Unified Socket Interface                    
00003 // % File            :      GUSINull.nw                 -      Null device                                   
00004 // % Author   :      Matthias Neeracher                                           
00005 // % Language :      C++                                                        
00006 // %                                                                       
00007 // % $Log: GUSINull.h,v $
00008 // % Revision 1.1  2001/03/11 22:37:20  sgehani%netscape.com
00009 // % First Checked In.
00010 // %                                                 
00011 // % Revision 1.7  2000/03/06 06:03:29  neeri                              
00012 // % Check device families for file paths                                  
00013 // %                                                                       
00014 // % Revision 1.6  1999/08/26 05:45:05  neeri                              
00015 // % Fixes for literate edition of source code                             
00016 // %                                                                       
00017 // % Revision 1.5  1999/05/29 06:26:44  neeri                              
00018 // % Fixed header guards                                                   
00019 // %                                                                       
00020 // % Revision 1.4  1999/04/29 05:34:22  neeri                              
00021 // % Support stat/fstat                                                    
00022 // %                                                                       
00023 // % Revision 1.3  1999/03/17 09:05:10  neeri                              
00024 // % Added GUSITimer, expanded docs                                        
00025 // %                                                                       
00026 // % Revision 1.2  1998/11/22 23:06:59  neeri                              
00027 // % Releasing 2.0a4 in a hurry                                            
00028 // %                                                                       
00029 // % Revision 1.1  1998/08/01 21:32:09  neeri                              
00030 // % About ready for 2.0a1                                                 
00031 // %                                                                       
00032 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00033 //                                                                         
00034 // \chapter{Null device}                                                   
00035 //                                                                         
00036 // A [[GUSINullSocket]] implements the null socket class for MacTCP. All instances
00037 // of [[GUSINullSocket]] are created by the [[GUSINullDevice]] singleton, so
00038 // there is no point in exporting the class itself.                        
00039 //                                                                         
00040 // <GUSINull.h>=                                                           
00041 #ifndef _GUSINull_
00042 #define _GUSINull_
00043 
00044 #ifdef GUSI_INTERNAL
00045 
00046 #include "GUSIDevice.h"
00047 
00048 // \section{Definition of [[GUSINullDevice]]}                              
00049 //                                                                         
00050 // [[GUSINullDevice]] is a singleton subclass of [[GUSIDevice]].           
00051 //                                                                         
00052 // <Definition of class [[GUSINullDevice]]>=                               
00053 class GUSINullDevice : public GUSIDevice {
00054 public:
00055        static GUSINullDevice *     Instance();
00056        virtual bool  Want(GUSIFileToken & file);
00057        virtual GUSISocket * open(GUSIFileToken & file, int flags);
00058        virtual int stat(GUSIFileToken & file, struct stat * buf);
00059        GUSISocket * open();
00060 protected:
00061        GUSINullDevice()                          {}
00062        static GUSINullDevice *     sInstance;
00063 };
00064 
00065 // <Inline member functions for class [[GUSINullDevice]]>=                 
00066 inline GUSINullDevice * GUSINullDevice::Instance()
00067 {
00068        if (!sInstance)
00069               sInstance = new GUSINullDevice;
00070        return sInstance;
00071 }
00072 
00073 #endif /* GUSI_INTERNAL */
00074 
00075 #endif /* _GUSINull_ */