-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathALoadMsg.cpp
61 lines (47 loc) · 1.05 KB
/
ALoadMsg.cpp
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
51
52
53
54
55
56
57
58
59
60
61
#include "std.h"
#include "rope.h"
#include "Message.h"
using namespace std;
ALoadMsg::ALoadMsg(SpmtThread* source_st, SpmtThread* target_st,
Object* array, int type_size, int index)
:
RoundTripMsg(MsgType::ALOAD, source_st, target_st, array)
{
this->type_size = type_size;
this->index = index;
}
bool
ALoadMsg::is_irrevocable()
{
return false;
}
void
ALoadMsg::show(ostream& os) const
{
os << "ALOAD";
}
void
ALoadMsg::show_detail(std::ostream& os, int id) const
{
//os << "#" << id << "\n";
}
bool
ALoadMsg::equal(Message* msg)
{
if (m_type != msg->get_type())
return false;
ALoadMsg* m = static_cast<ALoadMsg*>(msg);
// - 目标对象(即数组对象)
// - 元素的大小
// - 元素的索引
// + 源线程(即发起方法的线程。)
if (m_target_st != m->m_target_st)
return false;
if (type_size != m->type_size)
return false;
if (index != m->index)
return false;
if (m_source_st != m->m_source_st)
return false;
return true;
}