2
thread safe wrapper for input Stream
3
Copyright (C) 2000 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
14
#ifndef __THREADSAFEINPUTSTREAM_H
15
#define __THREADSAFEINPUTSTREAM_H
17
// read INTRO in threadQueue.h
18
// This class makes the inputStream (given in constructor)
19
// threadsafe by wrapping each call with a threadqueue.
21
// Important NOTE: the input pointer is the owned by this class !!!
22
// which means: we call delete on it!
24
#include "../util/abstract/threadQueue.h"
25
#include "inputStream.h"
28
class ThreadSafeInputStream : public InputStream {
30
ThreadQueue* threadQueue;
34
ThreadSafeInputStream(InputStream* input);
35
~ThreadSafeInputStream();
38
int open(const char* dest);
43
int read(char* ptr,int size);
44
int seek(long bytePos);
48
long getBytePosition();
50
void insertTimeStamp(TimeStamp* src,long key,int len);
51
TimeStamp* getTimeStamp(long key);
52
int bytesUntilNext(long key);