aboutsummaryrefslogtreecommitdiff
path: root/week13/Exercise3/Thread.h
blob: 3b0a5883927a25a5831a8d4d42ce0807366907bc (plain) (blame)
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
#pragma once
#include "User.h"

class Thread {
	char** messages;
	unsigned size;
	unsigned allocated;

	void resize();

	void free();
	void copyFrom(const Thread& other);

public:
	Thread();
	virtual ~Thread();
	Thread(const Thread& other);
	Thread& operator=(const Thread& other);
	Thread(Thread&& other);
	Thread& operator=(Thread&& other);

	void PostMessage(const User& poster, const char* message);

	friend class ThreadModerator;
};