MCPcopy Create free account
hub / github.com/DFHack/dfhack / adjust_vtable

Method adjust_vtable

library/DataDefs.cpp:405–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void virtual_identity::adjust_vtable(virtual_ptr obj, const virtual_identity *main) const
406{
407 auto vp = vtable_ptr();
408 if (vp) {
409 *(void**)obj = vp;
410 return;
411 }
412
413 if (main && main != this && is_subclass(main))
414 return;
415
416 std::cerr << "Attempt to create class '" << getName() << "' without known vtable." << std::endl;
417 throw DFHack::Error::VTableMissing(getName());
418}
419
420virtual_ptr virtual_identity::clone(virtual_ptr obj)
421{

Callers

nothing calls this directly

Calls 1

vtable_ptrFunction · 0.85

Tested by

no test coverage detected