summaryrefslogtreecommitdiff
path: root/src/py_xact.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/py_xact.cc')
-rw-r--r--src/py_xact.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/py_xact.cc b/src/py_xact.cc
index d98d226c..f5453d15 100644
--- a/src/py_xact.cc
+++ b/src/py_xact.cc
@@ -85,12 +85,9 @@ void export_xact()
class_< xact_base_t, bases<item_t> > ("TransactionBase")
.add_property("journal",
make_getter(&xact_base_t::journal,
- return_value_policy<reference_existing_object>()),
+ return_internal_reference<>()),
make_setter(&xact_base_t::journal,
with_custodian_and_ward<1, 2>()))
- .add_property("posts",
- make_getter(&xact_base_t::posts),
- make_setter(&xact_base_t::posts))
.def("__len__", posts_len)
.def("__getitem__", posts_getitem,
@@ -100,6 +97,12 @@ void export_xact()
.def("remove_post", &xact_base_t::add_post)
.def("finalize", &xact_base_t::finalize)
+
+ .def("__iter__", range<return_internal_reference<> >
+ (&xact_t::posts_begin, &xact_t::posts_end))
+ .def("posts", range<return_internal_reference<> >
+ (&xact_t::posts_begin, &xact_t::posts_end))
+
.def("valid", &xact_base_t::valid)
;
@@ -119,6 +122,8 @@ void export_xact()
.def("lookup", &xact_t::lookup)
+ .def("clear_xdata", &xact_t::clear_xdata)
+
.def("valid", &xact_t::valid)
;
@@ -141,7 +146,7 @@ void export_xact()
("AutomatedTransactionFinalizer")
.add_property("journal",
make_getter(&auto_xact_finalizer_t::journal,
- return_value_policy<reference_existing_object>()),
+ return_internal_reference<>()),
make_setter(&auto_xact_finalizer_t::journal,
with_custodian_and_ward<1, 2>()))
.def("__call__", &auto_xact_finalizer_t::operator())