MCPcopy Create free account
hub / github.com/apache/arrow / deref

Function deref

cpp/gdb_arrow.py:145–157  ·  view source on GitHub ↗

Dereference a raw or smart pointer.

(val)

Source from the content-addressed store, hash-verified

143
144
145def deref(val):
146 """
147 Dereference a raw or smart pointer.
148 """
149 ty = get_basic_type(val.type)
150 if ty.code == gdb.TYPE_CODE_PTR:
151 return val.dereference()
152 if ty.name.startswith('std::'):
153 if "shared" in ty.name:
154 return SharedPtr(val).value
155 if "unique" in ty.name:
156 return UniquePtr(val).value
157 raise TypeError(f"Cannot dereference value of type '{ty.name}'")
158
159
160_string_literal_mapping = {

Callers 15

__getitem__Method · 0.85
__getitem__Method · 0.85
typeMethod · 0.85
__init__Method · 0.85
storage_typeMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
to_stringMethod · 0.85
__new__Method · 0.85
typeMethod · 0.85
to_stringMethod · 0.85

Calls 3

SharedPtrClass · 0.85
UniquePtrClass · 0.85
TypeErrorFunction · 0.50

Tested by

no test coverage detected