|
#pragma once
#include "qe.h"
#include "queue.h"
/****************************************************************************
* CReaderFiber
****************************************************************************/
#define MAX_LINE 1024
class CReaderFiber : public QE {
public: // constructors
CReaderFiber(LPCTSTR f, int c, Queue * q) : QE(reader) {
name = f;
count = c;
queue = q;
// initialize internal state
file = NULL;
}
virtual ~CReaderFiber() { if(file != NULL) fclose(file); }
public: // parameters
LPCTSTR name; // name of file
int count; // number of lines to write
Queue * queue; // the queue shared by all these fibers
public:
virtual void Display(LPCTSTR s);
public: // local state
FILE * file; // currently-opened file object
char buffer[MAX_LINE]; // local buffer
protected:
static void CALLBACK reader(LPVOID p);
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.