MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / walk_table

Method walk_table

src/simulate/data_walker.cpp:140–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 }
139
140 void DataWalker::walk_table ( Table * tab, TypeInfo * info ) {
141 if ( !canVisitTableData(info) ) return;
142 int keySize = info->firstType->size;
143 int valueSize = info->secondType->size;
144 uint64_t count = 0;
145 for ( uint64_t i=0, is=tab->capacity; i!=is; ++i ) {
146 if ( tableLiveSlot(*tab, i) ) {
147 bool last = (count == (tab->size-1));
148 // key
149 char * key = tab->keys + i*keySize;
150 beforeTableKey(tab, info, key, info->firstType, count, last);
151 if ( cancel() ) return;
152 walk ( key, info->firstType );
153 if ( cancel() ) return;
154 afterTableKey(tab, info, key, info->firstType, count, last);
155 if ( cancel() ) return;
156 // value
157 char * value = tab->data + i*valueSize;
158 beforeTableValue(tab, info, value, info->secondType, count, last);
159 if ( cancel() ) return;
160 walk ( value, info->secondType );
161 if ( cancel() ) return;
162 afterTableValue(tab, info, value, info->secondType, count, last);
163 if ( cancel() ) return;
164 // next
165 count ++;
166 }
167 }
168 }
169
170 void DataWalker::walk ( char * pa, TypeInfo * info ) {
171 if ( pa == nullptr ) {

Callers

nothing calls this directly

Calls 8

canVisitTableDataFunction · 0.85
tableLiveSlotFunction · 0.85
beforeTableKeyFunction · 0.85
cancelFunction · 0.85
walkFunction · 0.85
afterTableKeyFunction · 0.85
beforeTableValueFunction · 0.85
afterTableValueFunction · 0.85

Tested by

no test coverage detected