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

SerialStream.h

Go to the documentation of this file.
00001 /*
00002  * Time-stamp: <00/08/08 01:20:09 pagey>
00003  *
00004  * $Id: SerialStream.h,v 1.11 2000/08/08 08:36:02 pagey Exp $ 
00005  *
00006  *
00007  */
00008 #ifndef SerialStream_h
00009 #define SerialStream_h
00010 
00011 #include <string>
00012 #include <fstream>
00013 /* We need to figure out if we are using STLPORT implementation of the
00014    C++ Standard Template Library. If so, we need to start using the
00015    __STLPORT_STD namespace.
00016 
00017 */
00018 #ifdef __STLPORT_STD
00019 using namespace __STLPORT_STD ;
00020 #endif
00021 
00022 extern "C++" {
00023   namespace LibSerial {
00054     class SerialStream : public iostream {
00055     public:
00059 
00061 
00062 
00066 
00068 
00069       /* ----------------------------------------------------------------------
00070        * Public Static Members
00071        * ---------------------------------------------------------------------- */
00075 
00077 
00081 
00083 
00087 
00110       explicit SerialStream( const string       filename, 
00111                              ios_base::openmode mode = ios::in|ios::out) ;
00112 
00118       // explicit SerialStream() ;
00119       
00124       virtual ~SerialStream() ; 
00126 
00134       //void open(const char *s, ios_base::openmode mode = ios_base::in | ios_base::out) ;
00135 
00140       //void close() ;
00141 
00145       void SetBaudRate(BaudRateEnum baud_rate) ;
00146 
00155       const SerialStreamBuf::BaudRateEnum BaudRate() const ;
00156 
00161       void SetCharSize(const CharSizeEnum size) ;
00162 
00167       const SerialStreamBuf::CharSizeEnum CharSize() const ;
00168 
00175       void SetNumOfStopBits(short stop_bits) ;
00176 
00181       const short NumOfStopBits() const ; 
00182 
00188       void SetParity(const ParityEnum parity) ;
00189 
00195       const SerialStreamBuf::ParityEnum Parity() const ;
00196 
00200       const SerialStreamBuf::FlSetFlowControl
00201       SetFlowControl(const SerialStreamBuf::FlowControlEnum flow_c) ;
00202 
00206       const SerialStreamBuf::FlowControlEnum 
00207       FlowControl() const ;
00208 
00210 
00214 
00216 
00217       /* ----------------------------------------------------------------------
00218        * Friends
00219        * ----------------------------------------------------------------------
00220        */
00221     protected:
00222       /* ----------------------------------------------------------------------
00223        * Protected Data Members
00224        * ----------------------------------------------------------------------
00225        */
00226       /* ----------------------------------------------------------------------
00227        * Protected Methods
00228        * ----------------------------------------------------------------------
00229        */
00230     private:
00231       /* ----------------------------------------------------------------------
00232        * Private Data Members
00233        * ----------------------------------------------------------------------
00234        */
00235 
00236       /* ----------------------------------------------------------------------
00237        * Private Methods
00238        * ----------------------------------------------------------------------
00239        */
00250       void IgnoreModemStatusLines(bool ignore=true) ;
00251 
00259       void EnableReceiver(bool enable=true) ;
00260 
00261     } ; // class SerialStream
00262 
00263     inline
00264     SerialStream::~SerialStream() {
00265       if( -1 != mFileDescriptor ) {
00266         ::close(mFileDescriptor) ;
00267       }
00268     }
00269   } ; // namespace LibSerial
00270 } // extern "C++"
00271 #endif // #ifndef SerialStream_h

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