2 * Worldvisions Weaver Software:
3 * Copyright (C) 2005 Net Integration Technologies, Inc.
5 * Allows one to wrap a UniConf tree with a transaction model. Use
6 * UniTransaction::commit() to commit, and
7 * UniTransaction::refresh() to rollback.
9 #ifndef _UNITRANSACTION_H
10 #define _UNITRANSACTION_H
12 #include "unibachelorgen.h"
13 #include "uniconfroot.h"
14 #include "unitransactiongen.h"
15 #include "uniunwrapgen.h"
18 * Wraps an existing UniConf tree with a transaction generator.
20 class UniTransaction
: public UniConfRoot
23 friend class UniConf::Iter
;
24 friend class UniConf::RecursiveIter
;
27 UniTransaction(const UniConf
&base
)
28 : UniConfRoot(new UniTransactionGen(new UniBachelorGen(
29 new UniUnwrapGen(base
))), false)
33 // C++ would auto-generate a "copy constructor" for this function, but
34 // what we really want is just to wrap a new transaction around the
35 // base, just like any other UniConf object.
36 UniTransaction(const UniTransaction
&base
)
37 : UniConfRoot(new UniTransactionGen(new UniBachelorGen(
38 new UniUnwrapGen(base
))), false)
43 #endif /* _UNITRANSACTION_H */