-
Notifications
You must be signed in to change notification settings - Fork 5
/
poThreadCenter.h
50 lines (34 loc) · 1.03 KB
/
poThreadCenter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
/* Created by Stephen Varga on 11/14/11.
* Copyright 2011 Potion Design. All rights reserved.
*/
#include "poObject.h"
class poWorker;
//Thread Center
namespace poThreadCenter {
void init();
void shutdown();
void update();
void addItem(poWorker *worker, poObject *notify, std::string message = "", const poDictionary &dict = poDictionary());
void workerDone(poWorker *threadedObject);
};
//------------------------------------------------------------------
//Base Class for all workers
class poWorker : public poObject {
public:
poWorker();
virtual ~poWorker();
virtual void workerFunc();
virtual void setWorkerParams(poObject *notify, std::string message, const poDictionary &dict);
void run();
poObject* getWorkerNotify();
std::string getWorkerMessage();
bool workerShouldBeDeleted();
poDictionary dict;
float poWorkerStartTime;
bool workerAutoDelete;
std::string workerMessage;
private:
//Worker params/info
poObject *notify;
};