Wyatt
1.0.1
Main Page
Classes
Files
File List
src
commands
Command.cpp
1
//
2
// Created by Arthur Lockman on 4/5/17.
3
//
4
5
#include "Command.h"
6
7
Command::Command
()
8
{
9
10
}
11
12
Command::~Command
() {
13
14
}
15
16
void
Command::init
()
17
{
18
m_lock
.lock();
19
m_is_initialized =
true
;
20
m_lock
.unlock();
21
}
22
23
void
Command::cancel
()
24
{
25
m_lock
.lock();
26
m_is_running =
false
;
27
this->
cleanup
(
true
);
28
m_is_finished =
true
;
29
m_lock
.unlock();
30
}
31
32
void
Command::stop
()
33
{
34
m_lock
.lock();
35
m_is_running =
false
;
36
this->
cleanup
(
false
);
37
m_is_finished =
true
;
38
m_lock
.unlock();
39
}
40
41
bool
Command::isRunning
()
42
{
43
m_lock
.lock();
44
bool
tmp = m_is_running;
45
m_lock
.unlock();
46
return
tmp;
47
}
48
49
bool
Command::isInitialized
()
50
{
51
m_lock
.lock();
52
bool
tmp = m_is_initialized;
53
m_lock
.unlock();
54
return
tmp;
55
}
56
57
void
Command::setIsRunning
(
bool
value)
58
{
59
m_lock
.lock();
60
m_is_running = value;
61
m_lock
.unlock();
62
}
63
64
bool
Command::isFinished
()
65
{
66
m_lock
.lock();
67
bool
tmp = m_is_finished;
68
m_lock
.unlock();
69
return
tmp;
70
}
Command::isInitialized
bool isInitialized()
Definition:
Command.cpp:49
Command::Command
Command()
Definition:
Command.cpp:7
Command::setIsRunning
void setIsRunning(bool value)
Definition:
Command.cpp:57
Command::cancel
void cancel()
Definition:
Command.cpp:23
Command::stop
void stop()
Definition:
Command.cpp:32
Command::~Command
virtual ~Command()
Definition:
Command.cpp:12
Command::m_lock
std::mutex m_lock
Lock for managing access to member variables in a thread-safe manner.
Definition:
Command.h:76
Command::cleanup
virtual bool cleanup(bool canceled)=0
Command::init
void init()
Definition:
Command.cpp:16
Command::isFinished
bool isFinished()
Definition:
Command.cpp:64
Command::isRunning
bool isRunning()
Definition:
Command.cpp:41
Generated by
1.8.11