blob: 56ac3d6e94f3f896fdad34569a9742d74aee25fd [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001/**
2 * Copyright (C) ARM Limited 2010-2014. All rights reserved.
3 *
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