-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfloat_type.cpp
More file actions
59 lines (48 loc) · 1.21 KB
/
float_type.cpp
File metadata and controls
59 lines (48 loc) · 1.21 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
51
52
53
54
55
56
57
58
59
#include "float_type.h"
float_type::float_type(QObject *parent) : QObject(parent)
{
}
void float_type::operation(int i)
{
if(i==1)//make
{
int current_row=m_writer->get_current_row();
m_writer->writefile(m_writer->parsefilename,"offset=4;memcpy((void *)(ptData), (void *)&"+variable_name+", offset);ptData += offset;size+=offset;",current_row);
return;
}
else
{
m_writer->writefile(m_writer->parsefilename,"offset=4;memcpy((void *)&"+variable_name+",(void *)(ptData), offset);"+"ptData += offset;",0);
return;
}
}
void float_type::setparents(metafile *parents)
{
parentmetafile=parents;
// reset_variablename();
}
void float_type::rename_iterate()
{
//如果在最表层,则parent为ptopic
setvariablename(parentmetafile->getvariablename()+"."+variable_name);
qDebug()<<variable_name;
}
void float_type::setvariablename(QString name)
{
variable_name=name;
}
int float_type::getsize()
{
return 4;
}
QString float_type::getvariablename()
{
return variable_name;
}
metafile *float_type::deep_copy()
{
float_type *type=new float_type;
type->variable_name=this->variable_name;
type->m_writer=m_writer;
return type;
}