LLDB mainline
lldb_private::python::ScopedPythonObject< T > Class Template Reference

A class that automatically clears an SB object when it goes out of scope. More...

#include <SWIGPythonBridge.h>

Inheritance diagram for lldb_private::python::ScopedPythonObject< T >:
[legend]

Public Member Functions

 ScopedPythonObject (T *sb, swig_type_info *info)
 ~ScopedPythonObject ()
 ScopedPythonObject (ScopedPythonObject &&rhs)
 ScopedPythonObject (const ScopedPythonObject &)=delete
ScopedPythonObjectoperator= (const ScopedPythonObject &)=delete
ScopedPythonObjectoperator= (ScopedPythonObject &&)=delete
const PythonObjectobj () const

Private Attributes

T * m_sb
Private Attributes inherited from lldb_private::python::PythonObject
PyObject * m_py_obj = nullptr

Additional Inherited Members

Private Member Functions inherited from lldb_private::python::PythonObject
 PythonObject ()=default
 PythonObject (PyRefType type, PyObject *py_obj)
 PythonObject (const PythonObject &rhs)
 PythonObject (PythonObject &&rhs)
 ~PythonObject ()
void Reset ()
void Dump (Stream &strm) const
PyObject * get () const
PyObject * release ()
PythonObjectoperator= (PythonObject other)
PyObjectType GetObjectType () const
PythonString Repr () const
PythonString Str () const
PythonObject ResolveName (llvm::StringRef name) const
template<typename T>
ResolveName (llvm::StringRef name) const
bool HasAttribute (llvm::StringRef attribute) const
PythonObject GetAttributeValue (llvm::StringRef attribute) const
bool IsNone () const
bool IsValid () const
bool IsAllocated () const
 operator bool () const
template<typename T>
AsType () const
StructuredData::ObjectSP CreateStructuredObject () const
template<typename... T>
llvm::Expected< PythonObjectCallMethod (const char *name, const T &... t) const
template<typename... T>
llvm::Expected< PythonObjectCall (const T &... t) const
llvm::Expected< PythonObjectGetAttribute (const llvm::Twine &name) const
llvm::Expected< PythonObjectGetType () const
llvm::Expected< boolIsTrue ()
llvm::Expected< long long > AsLongLong () const
llvm::Expected< unsigned long long > AsUnsignedLongLong () const
llvm::Expected< unsigned long long > AsModuloUnsignedLongLong () const
llvm::Expected< boolIsInstance (const PythonObject &cls)
Static Private Member Functions inherited from lldb_private::python::PythonObject
static PythonObject ResolveNameWithDictionary (llvm::StringRef name, const PythonDictionary &dict)
template<typename T>
static T ResolveNameWithDictionary (llvm::StringRef name, const PythonDictionary &dict)

Detailed Description

template<typename T>
class lldb_private::python::ScopedPythonObject< T >

A class that automatically clears an SB object when it goes out of scope.

Use for cases where the SB object points to a temporary/unowned entity.

Definition at line 43 of file SWIGPythonBridge.h.

Constructor & Destructor Documentation

◆ ScopedPythonObject() [1/3]

template<typename T>
lldb_private::python::ScopedPythonObject< T >::ScopedPythonObject ( T * sb,
swig_type_info * info )
inline

◆ ~ScopedPythonObject()

template<typename T>
lldb_private::python::ScopedPythonObject< T >::~ScopedPythonObject ( )
inline

Definition at line 47 of file SWIGPythonBridge.h.

References m_sb.

◆ ScopedPythonObject() [2/3]

template<typename T>
lldb_private::python::ScopedPythonObject< T >::ScopedPythonObject ( ScopedPythonObject< T > && rhs)
inline

◆ ScopedPythonObject() [3/3]

template<typename T>
lldb_private::python::ScopedPythonObject< T >::ScopedPythonObject ( const ScopedPythonObject< T > & )
delete

References ScopedPythonObject().

Member Function Documentation

◆ obj()

template<typename T>
const PythonObject & lldb_private::python::ScopedPythonObject< T >::obj ( ) const
inline

◆ operator=() [1/2]

template<typename T>
ScopedPythonObject & lldb_private::python::ScopedPythonObject< T >::operator= ( const ScopedPythonObject< T > & )
delete

References ScopedPythonObject().

◆ operator=() [2/2]

template<typename T>
ScopedPythonObject & lldb_private::python::ScopedPythonObject< T >::operator= ( ScopedPythonObject< T > && )
delete

References ScopedPythonObject().

Member Data Documentation

◆ m_sb

template<typename T>
T* lldb_private::python::ScopedPythonObject< T >::m_sb
private

Definition at line 60 of file SWIGPythonBridge.h.

Referenced by ScopedPythonObject(), ScopedPythonObject(), and ~ScopedPythonObject().


The documentation for this class was generated from the following file: