* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
[svn.git] / subversion / bindings / javahl / native / Pool.h
blob15f3e35ddcb35f09a20faabfb334f865470ef03e
1 /**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2003-2007 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
16 * @endcopyright
18 * @file Pool.h
19 * @brief Interface of the class Pool
22 #ifndef POOL_H
23 #define POOL_H
25 #include "svn_pools.h"
27 /**
28 * This class manages one APR pool. Objects of this class are
29 * allocated on the stack of the SVNClient and SVNAdmin methods as the
30 * request pool. Leaving the methods will destroy the pool.
32 class Pool
34 public:
35 Pool();
36 ~Pool();
37 apr_pool_t *pool() const;
38 void clear() const;
40 private:
41 /**
42 * The apr pool request pool.
44 apr_pool_t *m_pool;
46 /**
47 * We declare the copy constructor and assignment operator private
48 * here, so that the compiler won't inadvertently use them for us.
49 * The default copy constructor just copies all the data members,
50 * which would create two pointers to the same pool, one of which
51 * would get destroyed while the other thought it was still
52 * valid...and BOOM! Hence the private declaration.
54 Pool(Pool &that);
55 Pool &operator= (Pool &that);
58 // The following one-line functions are best inlined by the compiler, and
59 // need to be implemented in the header file for that to happen.
61 APR_INLINE
62 apr_pool_t *Pool::pool () const
64 return m_pool;
67 APR_INLINE
68 void Pool::clear() const
70 svn_pool_clear(m_pool);
74 #endif // POOL_H