MCPcopy Create free account
hub / github.com/chokkan/crfsuite / SwigPtr_PyObject

Class SwigPtr_PyObject

swig/python/export_wrap.cpp:3492–3535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3490
3491namespace swig {
3492 class SwigPtr_PyObject {
3493 protected:
3494 PyObject *_obj;
3495
3496 public:
3497 SwigPtr_PyObject() :_obj(0)
3498 {
3499 }
3500
3501 SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
3502 {
3503 Py_XINCREF(_obj);
3504 }
3505
3506 SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3507 {
3508 if (initial_ref) {
3509 Py_XINCREF(_obj);
3510 }
3511 }
3512
3513 SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
3514 {
3515 Py_XINCREF(item._obj);
3516 Py_XDECREF(_obj);
3517 _obj = item._obj;
3518 return *this;
3519 }
3520
3521 ~SwigPtr_PyObject()
3522 {
3523 Py_XDECREF(_obj);
3524 }
3525
3526 operator PyObject *() const
3527 {
3528 return _obj;
3529 }
3530
3531 PyObject *operator->() const
3532 {
3533 return _obj;
3534 }
3535 };
3536}
3537
3538

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected