Lines Matching refs:PythonObject
66 class PythonObject; variable
225 T, typename std::enable_if<std::is_base_of<PythonObject, T>::value>::type> {
230 class PythonObject {
232 PythonObject() : m_py_obj(nullptr) {}
234 PythonObject(PyRefType type, PyObject *py_obj) {
244 PythonObject(const PythonObject &rhs)
245 : PythonObject(PyRefType::Borrowed, rhs.m_py_obj) {}
247 PythonObject(PythonObject &&rhs) {
252 ~PythonObject() { Reset(); }
277 PythonObject &operator=(PythonObject other) {
289 static PythonObject ResolveNameWithDictionary(llvm::StringRef name,
298 PythonObject ResolveName(llvm::StringRef name) const;
306 PythonObject GetAttributeValue(llvm::StringRef attribute) const;
325 llvm::Expected<PythonObject> CallMethod(const char *name,
333 return python::Take<PythonObject>(obj);
337 llvm::Expected<PythonObject> Call(const T &... t) const {
343 return python::Take<PythonObject>(obj);
346 llvm::Expected<PythonObject> GetAttribute(const llvm::Twine &name) 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 {
419 PythonObject::operator=(PythonObject(type, py_obj));
529 PythonObject GetItemAtIndex(uint32_t index) const;
531 void SetItemAtIndex(uint32_t index, const PythonObject &object);
533 void AppendItem(const PythonObject &object);
544 PythonTuple(std::initializer_list<PythonObject> objects);
551 PythonObject GetItemAtIndex(uint32_t index) const;
553 void SetItemAtIndex(uint32_t index, const PythonObject &object);
572 PythonObject GetItemForKey(const PythonObject &key) const; // DEPRECATED
573 void SetItemForKey(const PythonObject &key,
574 const PythonObject &value); // DEPRECATED
576 llvm::Expected<PythonObject> GetItem(const PythonObject &key) const;
577 llvm::Expected<PythonObject> GetItem(const llvm::Twine &key) const;
578 llvm::Error SetItem(const PythonObject &key, const PythonObject &value) const;
579 llvm::Error SetItem(const llvm::Twine &key, const PythonObject &value) const;
609 llvm::Expected<PythonObject> Get(const llvm::Twine &name);
630 PythonObject operator()();
632 PythonObject operator()(std::initializer_list<PyObject *> args);
634 PythonObject operator()(std::initializer_list<PythonObject> args);
637 PythonObject operator()(const Arg &arg, Args... args) {
716 llvm::Expected<PythonObject> runStringOneLine(const llvm::Twine &string,
720 llvm::Expected<PythonObject> runStringMultiLine(const llvm::Twine &string,
751 llvm::Expected<PythonObject> operator()(Args &&... args) {