aboutsummaryrefslogtreecommitdiff
path: root/week13/Exercise3/Thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'week13/Exercise3/Thread.h')
-rw-r--r--week13/Exercise3/Thread.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/week13/Exercise3/Thread.h b/week13/Exercise3/Thread.h
new file mode 100644
index 0000000..3b0a588
--- /dev/null
+++ b/week13/Exercise3/Thread.h
@@ -0,0 +1,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;
+};