Skip to content

Commit 3184243

Browse files
committed
Add fast type synthetic provider
1 parent a94d415 commit 3184243

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

extra/decimal_printer.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,37 @@ def update(self):
106106

107107
def has_children(self):
108108
return True
109+
110+
class DecimalFastSyntheticProvider:
111+
def __init__(self, valobj, internal_dict):
112+
self.valobj = valobj
113+
114+
def num_children(self):
115+
return 3
116+
117+
def get_child_index(self, name):
118+
if name == "significand_":
119+
return 0
120+
elif name == "exponent_":
121+
return 1
122+
elif name == "sign_":
123+
return 2
124+
else:
125+
return -1
126+
127+
def get_child_at_index(self, index):
128+
if index == 0:
129+
return self.valobj.GetChildMemberWithName("significand_")
130+
elif index == 1:
131+
return self.valobj.GetChildMemberWithName("exponent_")
132+
elif index == 2:
133+
return self.valobj.GetChildMemberWithName("sign_")
134+
else:
135+
return None
136+
137+
def update(self):
138+
pass
139+
140+
def has_children(self):
141+
return True
142+

0 commit comments

Comments
 (0)