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

Class SharedPtr

cpp/gdb_arrow.py:376–401  ·  view source on GitHub ↗

A `std::shared_ptr ` value.

Source from the content-addressed store, hash-verified

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