MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / linkVarTypes

Method linkVarTypes

src/hx/cppia/CppiaVars.cpp:87–114  ·  view source on GitHub ↗

Static...

Source from the content-addressed store, hash-verified

85
86// Static...
87void CppiaVar::linkVarTypes(CppiaModule &cppia)
88{
89 if (dynamicFunction)
90 {
91 nameId = dynamicFunction->nameId;
92 }
93 type = cppia.types[typeId];
94 name = cppia.strings[nameId];
95 exprType = typeId==0 ? etObject : type->expressionType;
96
97 if (!isVirtual)
98 {
99 storeType = typeId==0 ? fsObject : fieldStorageFromType(type);
100
101 switch(storeType)
102 {
103 case fsBool: valPointer = &boolVal; break;
104 case fsByte: valPointer = &byteVal; break;
105 case fsInt: valPointer = &intVal; break;
106 case fsFloat: valPointer = &floatVal; break;
107 case fsString: valPointer = &stringVal; break;
108 case fsObject: valPointer = &objVal; break;
109 default:
110 valPointer = 0;
111 throw "Unkown store type";
112 }
113 }
114}
115
116bool CppiaVar::hasPointer()
117{

Callers 1

linkTypesMethod · 0.80

Calls 2

fieldStorageFromTypeFunction · 0.85
AlignOffsetFunction · 0.85

Tested by

no test coverage detected