/*
 * See the files COPYING and README for copyright information and how to reach
 * the author.
 *
 *  $Id: poller.h,v 1.2 2006/01/21 19:37:28 lordjaxom Exp $
 */

#ifndef VDR_BURN_POLLER_H
#define VDR_BURN_POLLER_H

#include <cstdio>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

class cBurnPipes;
class cBurnProcess;

class cBurnPoller
{
private:
	cBurnPipes *mPipes;
	int         mCount;
	fd_set      mReadFds;
	char      **mBuffers;
	
protected:
	void Clear(void) { FD_ZERO(&mReadFds); }

public:
	cBurnPoller(void);
	~cBurnPoller();

	void Set(cBurnPipes *Pipes);
	bool Poll(int TimeoutMs);
	bool Read(cBurnProcess *Process);
};

#endif // VDR_BURN_POLLER_H
