WvStreams
unitransaction.h
1 /* -*- Mode: C++ -*-
2  * Worldvisions Weaver Software:
3  * Copyright (C) 2005 Net Integration Technologies, Inc.
4  *
5  * Allows one to wrap a UniConf tree with a transaction model. Use
6  * UniTransaction::commit() to commit, and
7  * UniTransaction::refresh() to rollback.
8  */
9 #ifndef _UNITRANSACTION_H
10 #define _UNITRANSACTION_H
11 
12 #include "unibachelorgen.h"
13 #include "uniconfroot.h"
14 #include "unitransactiongen.h"
15 #include "uniunwrapgen.h"
16 
21 {
22  friend class UniConf;
23  friend class UniConf::Iter;
24  friend class UniConf::RecursiveIter;
25 
26 public:
27  UniTransaction(const UniConf &base)
29  new UniUnwrapGen(base))), false)
30  {
31  }
32 
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)
38  new UniUnwrapGen(base))), false)
39  {
40  }
41 };
42 
43 #endif /* _UNITRANSACTION_H */