| 22 | } |
| 23 | |
| 24 | void DataWalker::walk_struct ( char * ps, StructInfo * si ) { |
| 25 | if ( ps && (si->flags & StructInfo::flag_class) ) { |
| 26 | auto ti = *(TypeInfo **) ps; |
| 27 | if ( ti!=nullptr ) si = ti->structType; |
| 28 | else invalidData(); // we are walking uninitialized class here |
| 29 | } |
| 30 | if ( canVisitStructure_(ps, si) ) { |
| 31 | beforeStructure_(ps, si); |
| 32 | if ( cancel() ) { |
| 33 | afterStructureCancel_(ps, si); |
| 34 | return; |
| 35 | } |
| 36 | for ( uint32_t i=0, is=si->count; i!=is; ++i ) { |
| 37 | bool last = i==(si->count-1); |
| 38 | VarInfo * vi = si->fields[i]; |
| 39 | char * pf = ps + vi->offset; |
| 40 | beforeStructureField(ps, si, pf, vi, last); |
| 41 | if ( cancel() ) { |
| 42 | afterStructureCancel_(ps, si); |
| 43 | return; |
| 44 | } |
| 45 | walk(pf, vi); |
| 46 | if ( cancel() ) { |
| 47 | afterStructureCancel_(ps, si); |
| 48 | return; |
| 49 | } |
| 50 | afterStructureField(ps, si, pf, vi, last); |
| 51 | if ( cancel() ) { |
| 52 | afterStructureCancel_(ps, si); |
| 53 | return; |
| 54 | } |
| 55 | } |
| 56 | afterStructure_(ps, si); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void DataWalker::walk_tuple ( char * ps, TypeInfo * ti ) { |
| 61 | if ( canVisitTuple(ps,ti) ) { |
no test coverage detected