blob: b9369be5198b6006c35b7bf343a382f64275ddff [file] [log] [blame]
Jon Medhurst15ce78d2014-04-10 09:02:02 +01001/**
Jon Medhurstb1d07442015-05-08 12:04:18 +01002 * Copyright (C) ARM Limited 2010-2015. All rights reserved.
Jon Medhurst15ce78d2014-04-10 09:02:02 +01003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef SOURCE_H
10#define SOURCE_H
11
12#include <pthread.h>
13
14class Sender;
15
16class Source {
17public:
18 Source();
19 virtual ~Source();
20
21 virtual bool prepare() = 0;
22 void start();
23 virtual void run() = 0;
24 virtual void interrupt() = 0;
25 void join();
26
27 virtual bool isDone() = 0;
28 virtual void write(Sender *sender) = 0;
29
30private:
31 static void *runStatic(void *arg);
32
33 pthread_t mThreadID;
34
35 // Intentionally undefined
36 Source(const Source &);
37 Source &operator=(const Source &);
38};
39
40#endif // SOURCE_H