summaryrefslogtreecommitdiff
path: root/src/xact.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-12 14:29:08 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-12 14:29:08 -0500
commitbfd9ecf2af079894f95bac365818c9548f561039 (patch)
treedce7e13ec7ad8f18bc628efe511d17e94bc3e16d /src/xact.h
parenta034435c4287aba7fd32ed63a745e560350c924a (diff)
parent49a356f2d260ed0cc071ca1aa82027bd325b0b8b (diff)
downloadfork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.gz
fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.bz2
fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.zip
Merge branch 'next'
Diffstat (limited to 'src/xact.h')
-rw-r--r--src/xact.h74
1 files changed, 3 insertions, 71 deletions
diff --git a/src/xact.h b/src/xact.h
index ff1f65fa..fe748fcc 100644
--- a/src/xact.h
+++ b/src/xact.h
@@ -77,8 +77,10 @@ public:
value_t magnitude() const;
- virtual bool finalize();
+ bool finalize();
+ bool verify();
+ bool has_xdata();
void clear_xdata();
virtual bool valid() const {
@@ -140,11 +142,6 @@ private:
#endif // HAVE_BOOST_SERIALIZATION
};
-struct xact_finalizer_t {
- virtual ~xact_finalizer_t() {}
- virtual bool operator()(xact_t& xact) = 0;
-};
-
class auto_xact_t : public xact_base_t
{
public:
@@ -183,39 +180,6 @@ private:
#endif // HAVE_BOOST_SERIALIZATION
};
-struct auto_xact_finalizer_t : public xact_finalizer_t
-{
- journal_t * journal;
-
- auto_xact_finalizer_t() : journal(NULL) {
- TRACE_CTOR(auto_xact_finalizer_t, "");
- }
- auto_xact_finalizer_t(const auto_xact_finalizer_t& other)
- : xact_finalizer_t(), journal(other.journal) {
- TRACE_CTOR(auto_xact_finalizer_t, "copy");
- }
- auto_xact_finalizer_t(journal_t * _journal) : journal(_journal) {
- TRACE_CTOR(auto_xact_finalizer_t, "journal_t *");
- }
- ~auto_xact_finalizer_t() throw() {
- TRACE_DTOR(auto_xact_finalizer_t);
- }
-
- virtual bool operator()(xact_t& xact);
-
-#if defined(HAVE_BOOST_SERIALIZATION)
-private:
- /** Serialization. */
-
- friend class boost::serialization::access;
-
- template<class Archive>
- void serialize(Archive& ar, const unsigned int /* version */) {
- ar & journal;
- }
-#endif // HAVE_BOOST_SERIALIZATION
-};
-
class period_xact_t : public xact_base_t
{
public:
@@ -253,38 +217,6 @@ private:
#endif // HAVE_BOOST_SERIALIZATION
};
-class func_finalizer_t : public xact_finalizer_t
-{
- func_finalizer_t();
-
-public:
- typedef function<bool (xact_t& xact)> func_t;
-
- func_t func;
-
- func_finalizer_t(func_t _func) : func(_func) {
- TRACE_CTOR(func_finalizer_t, "func_t");
- }
- func_finalizer_t(const func_finalizer_t& other) :
- xact_finalizer_t(), func(other.func) {
- TRACE_CTOR(func_finalizer_t, "copy");
- }
- ~func_finalizer_t() throw() {
- TRACE_DTOR(func_finalizer_t);
- }
-
- virtual bool operator()(xact_t& xact) {
- return func(xact);
- }
-};
-
-void extend_xact_base(journal_t * journal, xact_base_t& xact);
-
-inline bool auto_xact_finalizer_t::operator()(xact_t& xact) {
- extend_xact_base(journal, xact);
- return true;
-}
-
typedef std::list<xact_t *> xacts_list;
typedef std::list<auto_xact_t *> auto_xacts_list;
typedef std::list<period_xact_t *> period_xacts_list;