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

Class SharedPtr

cpp/gdb_arrow.py:374–399  ·  view source on GitHub ↗

A `std::shared_ptr ` value.

Source from the content-addressed store, hash-verified

372# are stable), before falling back on calling the public API methods.
373
374class SharedPtr:
375 """
376 A `std::shared_ptr<T>` value.
377 """
378
379 def __init__(self, val):
380 self.val = val
381 try:
382 # libstdc++ internals
383 self._ptr = val['_M_ptr']
384 except gdb.error:
385 # fallback for other C++ standard libraries
386 self._ptr = gdb.parse_and_eval(f"{for_evaluation(val)}.get()")
387
388 def get(self):
389 """
390 Return the underlying pointer (a T*).
391 """
392 return self._ptr
393
394 @property
395 def value(self):
396 """
397 The underlying value (a T).
398 """
399 return self._ptr.dereference()
400
401
402class UniquePtr:

Callers 6

derefFunction · 0.85
__init__Method · 0.85
to_stringMethod · 0.85
to_stringMethod · 0.85
_bufferMethod · 0.85
_format_detailMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected