Lines Matching refs:PythonObject

66 class PythonObject;  variable
220 T, typename std::enable_if<std::is_base_of<PythonObject, T>::value>::type> {
225 class PythonObject {
227 PythonObject() = default;
229 PythonObject(PyRefType type, PyObject *py_obj) {
239 PythonObject(const PythonObject &rhs)
240 : PythonObject(PyRefType::Borrowed, rhs.m_py_obj) {}
242 PythonObject(PythonObject &&rhs) {
247 ~PythonObject() { Reset(); }
268 PythonObject &operator=(PythonObject other) {
280 static PythonObject ResolveNameWithDictionary(llvm::StringRef name,
289 PythonObject ResolveName(llvm::StringRef name) const;
297 PythonObject GetAttributeValue(llvm::StringRef attribute) const;
316 llvm::Expected<PythonObject> CallMethod(const char *name,
324 return python::Take<PythonObject>(obj);
328 llvm::Expected<PythonObject> Call(const T &... t) const {
334 return python::Take<PythonObject>(obj);
337 llvm::Expected<PythonObject> GetAttribute(const llvm::Twine &name) const {
343 return python::Take<PythonObject>(obj);
346 llvm::Expected<PythonObject> GetType() const {
352 return python::Take<PythonObject>(obj);
371 llvm::Expected<bool> IsInstance(const PythonObject &cls) {
386 template <typename T> llvm::Expected<T> As(llvm::Expected<PythonObject> &&obj) {
395 template <> llvm::Expected<bool> As<bool>(llvm::Expected<PythonObject> &&obj);
398 llvm::Expected<long long> As<long long>(llvm::Expected<PythonObject> &&obj);
402 As<unsigned long long>(llvm::Expected<PythonObject> &&obj);
405 llvm::Expected<std::string> As<std::string>(llvm::Expected<PythonObject> &&obj);
408 template <class T> class TypedPythonObject : public PythonObject {
414 PythonObject::operator=(PythonObject(type, py_obj));
526 PythonObject GetItemAtIndex(uint32_t index) const;
528 void SetItemAtIndex(uint32_t index, const PythonObject &object);
530 void AppendItem(const PythonObject &object);
541 PythonTuple(std::initializer_list<PythonObject> objects);
548 PythonObject GetItemAtIndex(uint32_t index) const;
550 void SetItemAtIndex(uint32_t index, const PythonObject &object);
571 PythonObject GetItemForKey(const PythonObject &key) const; // DEPRECATED
572 void SetItemForKey(const PythonObject &key,
573 const PythonObject &value); // DEPRECATED
575 llvm::Expected<PythonObject> GetItem(const PythonObject &key) const;
576 llvm::Expected<PythonObject> GetItem(const llvm::Twine &key) const;
577 llvm::Error SetItem(const PythonObject &key, const PythonObject &value) const;
578 llvm::Error SetItem(const llvm::Twine &key, const PythonObject &value) const;
608 llvm::Expected<PythonObject> Get(const llvm::Twine &name);
629 PythonObject operator()();
631 PythonObject operator()(std::initializer_list<PyObject *> args);
633 PythonObject operator()(std::initializer_list<PythonObject> args);
636 PythonObject operator()(const Arg &arg, Args... args) {
715 llvm::Expected<PythonObject> runStringOneLine(const llvm::Twine &string,
719 llvm::Expected<PythonObject> runStringMultiLine(const llvm::Twine &string,
750 llvm::Expected<PythonObject> operator()(Args &&... args) {
762 StructuredPythonObject(PythonObject obj)
768 PythonObject(PyRefType::Owned, static_cast<PyObject *>(GetValue()));