Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

MOSConnection.h

Go to the documentation of this file.
00001 #ifndef MOSConnection_h
00002 #define MOSConnection_h
00003 
00004 #include <Connection.h>
00005 #include "LibGPIB.h"
00006 
00007 extern "C++" {
00008   namespace LibGPIB {
00009     class MOSConnection : public Connection {
00010     public:
00011       const static int TERMINALS = 4 ;
00012 
00013       enum MOSTerminal {
00014         GATE=0, 
00015         DRAIN=1,
00016         SOURCE=2,
00017         SUBSTRATE=3
00018       } ;
00019 
00022       MOSConnection() ;
00023 
00024       virtual void Connect(int terminal, int smu) ;
00025       virtual int SMU(int terminal) ;
00026     protected:
00027     private:
00031       int mSMU[TERMINALS] ;
00032 
00033     } ; /* class MOSConnection */
00034 
00035     inline
00036     MOSConnection::MOSConnection() {
00037       for(int i=0; i<TERMINALS; i++) {
00038         mSMU[i] = (i+1) ;
00039       }
00040     }
00041 
00042     inline 
00043     void 
00044     MOSConnection::Connect(int terminal, int smu) {
00045       /*
00046        * Mon Mar  6 05:29:45 2000 Pagey
00047        * :TODO: Throw an exception if an invalid
00048        * smu number of terminal number is passed. 
00049        */
00050       if( (terminal >= 0) && (terminal < TERMINALS) && (smu > 0) ) {
00051         mSMU[terminal] = smu ;
00052       }
00053       return ;
00054     }
00055 
00056     inline 
00057     int MOSConnection::SMU(int terminal) {
00058       /*
00059        * Mon Mar  6 05:30:41 2000 Pagey
00060        * :TODO: Throw an exception if an invalid
00061        * smu number of terminal number is passed. 
00062        */
00063       if( (terminal >= 0) && (terminal < TERMINALS) ) {
00064         return mSMU[terminal] ;
00065       }
00066     }
00067 
00068   } // namespace LibGPIB
00069 } /* extern "C++" */
00070 #endif /* MOSConnection_h */

Generated at Tue Aug 8 01:37:55 2000 for libgpib by doxygen1.1.4 written by Dimitri van Heesch, © 1997-2000