INNER CODE UNIT · Python

num_children

Hekbas/Luth · luth/extern/source/tracy/extra/natvis.py:39

    def num_children(self):
        return 1

    def get_child_index(self, name):
        return int(name.lstrip('[').rstrip(']'))

    def get_child_at_index(self, index):
        return self.val.CreateValueFromAddress('m_ptr', self.ptr, self.type)

class VectorPrinter:
    def __init__(self, val, dict):
        self.val = val
        self.magic = bool(val.GetChildMemberWithName('m_magic').GetValueAsUnsigned())
        if self.magic:
            self.type = val.GetType().GetTemplateArgumentType(0).GetTemplateArgumentType(0)
        else:
            self.type = val.GetType().GetTemplateArgumentType(0)
        self.stride = self.type.GetByteSize()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…