-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShutdownCommand.h
More file actions
51 lines (31 loc) · 1.16 KB
/
ShutdownCommand.h
File metadata and controls
51 lines (31 loc) · 1.16 KB
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
//
// Created by Sierra Kilo on 22-Feb-19.
//
#ifndef EZREMOTE_PROJECT_COMPUTER_SERVER_SHUTDOWNCOMMAND_H
#define EZREMOTE_PROJECT_COMPUTER_SERVER_SHUTDOWNCOMMAND_H
using namespace std;
class ShutdownCommand {
private:
// flag used from the startShutdownTimer function when running in its thread
// to determine whether a cancel command was issued for the timer currently in use.
bool terminate_timer_flag = false;
std::mutex *mu_terminate_timer_flag;
std::thread timerThread;
void startShutdownTimer(TimeObject time_data);
void executeShutdown();
public:
ShutdownCommand();
//Delete the copy constructor
ShutdownCommand(const ShutdownCommand&) = delete;
//Delete the Assignment operator
ShutdownCommand& operator=(const ShutdownCommand&) = delete;
// Move Constructor
ShutdownCommand(ShutdownCommand&& obj);
//Move Assignment Operator
ShutdownCommand& operator=(ShutdownCommand&& obj);
void startShutdownTimerThread(TimeObject time_data);
void cancelShutdownTimer();
bool getTerminateTimerFlagValue();
~ShutdownCommand();
};
#endif //EZREMOTE_PROJECT_COMPUTER_SERVER_SHUTDOWNCOMMAND_H