forked from pop-team/pop-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypeclassstruct.cc
More file actions
45 lines (38 loc) · 1.16 KB
/
Copy pathtypeclassstruct.cc
File metadata and controls
45 lines (38 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
#include "type.h"
TypeClassStruct::TypeClassStruct(char* name, bool classtype) : DataType(name), TypeSeqClass(name), TypeStruct(name) {
isClass = classtype;
}
TypeClassStruct::~TypeClassStruct() {
}
bool TypeClassStruct::SetTypeClass(bool classtype) {
isClass = classtype;
return true;
}
bool TypeClassStruct::IsPrototype() {
if (isClass) {
return TypeSeqClass::IsPrototype();
} else {
return TypeStruct::IsPrototype();
}
}
int TypeClassStruct::CanMarshal() {
if (isClass) {
return TypeSeqClass::CanMarshal();
} else {
return TypeStruct::CanMarshal();
}
}
void TypeClassStruct::Marshal(char* varname, char* bufname, char* sizehelper, std::string& output) {
if (isClass) {
TypeSeqClass::Marshal(varname, bufname, sizehelper, output);
} else {
TypeStruct::Marshal(varname, bufname, sizehelper, output);
}
}
void TypeClassStruct::DeMarshal(char* varname, char* bufname, char* sizehelper, std::string& output) {
if (isClass) {
TypeSeqClass::DeMarshal(varname, bufname, sizehelper, output);
} else {
TypeStruct::DeMarshal(varname, bufname, sizehelper, output);
}
}