wvdbusserver: implement NameHasOwner request.
[wvstreams.git] / include / unitransaction.h
blob7be2f8c943ebf216725cc0baf26983b125447b8a
1 /* -*- Mode: C++ -*-
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.
8 */
9 #ifndef _UNITRANSACTION_H
10 #define _UNITRANSACTION_H
12 #include "unibachelorgen.h"
13 #include "uniconfroot.h"
14 #include "unitransactiongen.h"
15 #include "uniunwrapgen.h"
17 /**
18 * Wraps an existing UniConf tree with a transaction generator.
20 class UniTransaction : public UniConfRoot
22 friend class UniConf;
23 friend class UniConf::Iter;
24 friend class UniConf::RecursiveIter;
26 public:
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 */