forked from APrioriInvestments/typed_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoneType.hpp
More file actions
61 lines (42 loc) · 1.36 KB
/
Copy pathNoneType.hpp
File metadata and controls
61 lines (42 loc) · 1.36 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
60
#pragma once
#include "Type.hpp"
class None : public Type {
public:
None() : Type(TypeCategory::catNone)
{
m_name = "NoneType";
m_size = 0;
m_is_default_constructible = true;
}
bool isBinaryCompatibleWithConcrete(Type* other) {
if (other->getTypeCategory() != m_typeCategory) {
return false;
}
return true;
}
void _forwardTypesMayHaveChanged() {}
template<class visitor_type>
void _visitReferencedTypes(const visitor_type& v) {}
template<class visitor_type>
void _visitContainedTypes(const visitor_type& v) {}
bool cmp(instance_ptr left, instance_ptr right, int pyComparisonOp) {
return cmpResultToBoolForPyOrdering(pyComparisonOp, 0);
}
int32_t hash32(instance_ptr left) {
return (int)getTypeCategory();
}
void constructor(instance_ptr self) {}
void destroy(instance_ptr self) {}
void copy_constructor(instance_ptr self, instance_ptr other) {}
void assign(instance_ptr self, instance_ptr other) {}
static None* Make() { static None res; return &res; }
template<class buf_t>
void deserialize(instance_ptr self, buf_t& buffer) {
}
template<class buf_t>
void serialize(instance_ptr self, buf_t& buffer) {
}
void repr(instance_ptr self, ReprAccumulator& stream) {
stream << "None";
}
};