Back to index

lightning-sunbird  0.9+nobinonly
GUSIPipe.h
Go to the documentation of this file.
00001 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00002 // % Project  :      GUSI                        -      Grand Unified Socket Interface                    
00003 // % File            :      GUSIPipe.nw                 -      Pipes                                         
00004 // % Author   :      Matthias Neeracher                                           
00005 // % Language :      C++                                                        
00006 // %                                                                       
00007 // % $Log: GUSIPipe.h,v $
00008 // % Revision 1.1  2001/03/11 22:37:35  sgehani%netscape.com
00009 // % First Checked In.
00010 // %                                                 
00011 // % Revision 1.12  2000/05/23 07:18:03  neeri                             
00012 // % Improve formatting                                                    
00013 // %                                                                       
00014 // % Revision 1.11  2000/03/06 06:09:59  neeri                             
00015 // % Reorganize Yield()                                                    
00016 // %                                                                       
00017 // % Revision 1.10  1999/11/15 07:20:59  neeri                             
00018 // % Add GUSIwithLocalSockets                                              
00019 // %                                                                       
00020 // % Revision 1.9  1999/08/26 05:45:07  neeri                              
00021 // % Fixes for literate edition of source code                             
00022 // %                                                                       
00023 // % Revision 1.8  1999/06/28 06:05:00  neeri                              
00024 // % Support interrupted calls                                             
00025 // %                                                                       
00026 // % Revision 1.7  1999/05/29 06:26:45  neeri                              
00027 // % Fixed header guards                                                   
00028 // %                                                                       
00029 // % Revision 1.6  1999/03/17 09:05:12  neeri                              
00030 // % Added GUSITimer, expanded docs                                        
00031 // %                                                                       
00032 // % Revision 1.5  1998/11/22 23:07:00  neeri                              
00033 // % Releasing 2.0a4 in a hurry                                            
00034 // %                                                                       
00035 // % Revision 1.4  1998/10/25 11:57:38  neeri                              
00036 // % Ready to release 2.0a3                                                
00037 // %                                                                       
00038 // % Revision 1.3  1998/01/25 20:53:57  neeri                              
00039 // % Engine implemented, except for signals & scheduling                   
00040 // %                                                                       
00041 // % Revision 1.2  1996/12/22 19:57:58  neeri                              
00042 // % TCP streams work                                                      
00043 // %                                                                       
00044 // % Revision 1.1  1996/11/24  12:52:08  neeri                             
00045 // % Added GUSIPipeSockets                                                 
00046 // %                                                                       
00047 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00048 //                                                                         
00049 // \chapter{The GUSI Pipe Socket Class}                                    
00050 //                                                                         
00051 // Pipes and socket pairs are implemented with the [[GUSIPipeSocket]] class.
00052 // The [[GUSIPipeFactory]] singleton creates pairs of [[GUSIPipeSockets]]. 
00053 //                                                                         
00054 // <GUSIPipe.h>=                                                           
00055 #ifndef _GUSIPipe_
00056 #define _GUSIPipe_
00057 
00058 #ifdef GUSI_INTERNAL
00059 
00060 #include "GUSISocket.h"
00061 #include "GUSIFactory.h"
00062 
00063 // \section{Definition of [[GUSIPipeFactory]]}                             
00064 //                                                                         
00065 // [[GUSIPipeFactory]] is a singleton subclass of [[GUSISocketFactory]].   
00066 //                                                                         
00067 // <Definition of class [[GUSIPipeFactory]]>=                              
00068 class GUSIPipeFactory : public GUSISocketFactory {
00069 public:
00070        static GUSISocketFactory *  Instance();
00071        virtual GUSISocket *               socket(int domain, int type, int protocol);
00072        virtual int socketpair(int domain, int type, int protocol, GUSISocket * s[2]);
00073 private:
00074        GUSIPipeFactory()                         {}
00075        static GUSISocketFactory *  sInstance;
00076 };
00077 
00078 // <Inline member functions for class [[GUSIPipeFactory]]>=                
00079 inline GUSISocketFactory * GUSIPipeFactory::Instance()
00080 {
00081        if (!sInstance)
00082               sInstance = new GUSIPipeFactory;
00083        return sInstance;
00084 }
00085 
00086 #endif /* GUSI_INTERNAL */
00087 
00088 #endif /* _GUSIPipe_ */