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

/home/slang/XVision2/src/Pipes/PipeSys.h

00001 # ifndef _PIPSYS_H_
00002 # define _PIPSYS_H_
00003 
00004 # include "PipeEvents.h"
00005 
00006 // Time in seconds. count from 0
00007 extern Pipe<double> timePipe ;
00008 
00009 // Helper class
00010 class XVPipeTimer {
00011  protected:
00012   double nexttime ;
00013   double interval ;
00014   double endtime ; 
00015   bool forever ;
00016  public:
00017   XVPipeTimer( double total, double inter );  // total < 0 -> forever
00018   bool next(void);
00019 };
00020 
00021 // To run a pipe in a timable manner
00022 template<class T> 
00023 void runPipe( const Pipe<T>& pipe, 
00024            double interval = 0, double totaltime = -1 ) {
00025   XVPipeTimer t( totaltime, interval );
00026   Pipe<T> p(pipe);
00027   while( t.next() ) {
00028     try {
00029       p.next_value();
00030     }catch( BrokenPipe e ) {}
00031   }
00032 }
00033 
00034 // Raw terminal input -- not compatible with X
00035 PipeEvents<char> getPipeInputStream( int fd = 0 );
00036 
00037 # endif //_PIPSYS_H_

Generated at Thu Mar 29 22:37:28 2001 for XVision by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000