summaryrefslogtreecommitdiffstats
path: root/mmc_updater/src/UpdateMessage.h
blob: fee51ab86902412ec4568b18e874efab4343aefc (plain)
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
#pragma once

#include <string>

/** UpdateMessage stores information for a message
  * about the status of update installation sent
  * between threads.
  */
class UpdateMessage
{
	public:
		enum Type
		{
			UpdateFailed,
			UpdateProgress,
			UpdateFinished
		};

		UpdateMessage(void* receiver, Type type)
		{
			init(receiver,type);
		}

		UpdateMessage(Type type)
		{
			init(0,type);
		}

		void* receiver;
		Type type;
		std::string message;
		int progress;

	private:
		void init(void* receiver, Type type)
		{
			this->progress = 0;
			this->receiver = receiver;
			this->type = type;
		}
};