~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/dbinc/cxx_except.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*-
2
 
 * See the file LICENSE for redistribution information.
3
 
 *
4
 
 * Copyright (c) 1997-2002
5
 
 *      Sleepycat Software.  All rights reserved.
6
 
 *
7
 
 * $Id$
8
 
 */
9
 
 
10
 
#ifndef _CXX_EXCEPT_H_
11
 
#define _CXX_EXCEPT_H_
12
 
 
13
 
#include "cxx_common.h"
14
 
 
15
 
////////////////////////////////////////////////////////////////
16
 
////////////////////////////////////////////////////////////////
17
 
//
18
 
// Forward declarations
19
 
//
20
 
 
21
 
class DbDeadlockException;                       // forward
22
 
class DbException;                               // forward
23
 
class DbLockNotGrantedException;                 // forward
24
 
class DbLock;                                    // forward
25
 
class DbMemoryException;                         // forward
26
 
class DbRunRecoveryException;                    // forward
27
 
class Dbt;                                       // forward
28
 
 
29
 
////////////////////////////////////////////////////////////////
30
 
////////////////////////////////////////////////////////////////
31
 
//
32
 
// Exception classes
33
 
//
34
 
 
35
 
// Almost any error in the DB library throws a DbException.
36
 
// Every exception should be considered an abnormality
37
 
// (e.g. bug, misuse of DB, file system error).
38
 
//
39
 
// NOTE: We would like to inherit from class exception and
40
 
//       let it handle what(), but there are
41
 
//       MSVC++ problems when <exception> is included.
42
 
//
43
 
class _exported DbException
44
 
{
45
 
public:
46
 
        virtual ~DbException();
47
 
        DbException(int err);
48
 
        DbException(const char *description);
49
 
        DbException(const char *prefix, int err);
50
 
        DbException(const char *prefix1, const char *prefix2, int err);
51
 
        int get_errno() const;
52
 
        virtual const char *what() const;
53
 
 
54
 
        DbException(const DbException &);
55
 
        DbException &operator = (const DbException &);
56
 
 
57
 
private:
58
 
        char *what_;
59
 
        int err_;                   // errno
60
 
};
61
 
 
62
 
//
63
 
// A specific sort of exception that occurs when
64
 
// an operation is aborted to resolve a deadlock.
65
 
//
66
 
class _exported DbDeadlockException : public DbException
67
 
{
68
 
public:
69
 
        virtual ~DbDeadlockException();
70
 
        DbDeadlockException(const char *description);
71
 
 
72
 
        DbDeadlockException(const DbDeadlockException &);
73
 
        DbDeadlockException &operator = (const DbDeadlockException &);
74
 
};
75
 
 
76
 
//
77
 
// A specific sort of exception that occurs when
78
 
// a lock is not granted, e.g. by lock_get or lock_vec.
79
 
// Note that the Dbt is only live as long as the Dbt used
80
 
// in the offending call.
81
 
//
82
 
class _exported DbLockNotGrantedException : public DbException
83
 
{
84
 
public:
85
 
        virtual ~DbLockNotGrantedException();
86
 
        DbLockNotGrantedException(const char *prefix, db_lockop_t op,
87
 
            db_lockmode_t mode, const Dbt *obj, const DbLock lock, int index);
88
 
        DbLockNotGrantedException(const DbLockNotGrantedException &);
89
 
        DbLockNotGrantedException &operator =
90
 
            (const DbLockNotGrantedException &);
91
 
 
92
 
        db_lockop_t get_op() const;
93
 
        db_lockmode_t get_mode() const;
94
 
        const Dbt* get_obj() const;
95
 
        DbLock *get_lock() const;
96
 
        int get_index() const;
97
 
 
98
 
private:
99
 
        db_lockop_t op_;
100
 
        db_lockmode_t mode_;
101
 
        const Dbt *obj_;
102
 
        DbLock *lock_;
103
 
        int index_;
104
 
};
105
 
 
106
 
//
107
 
// A specific sort of exception that occurs when
108
 
// user declared memory is insufficient in a Dbt.
109
 
//
110
 
class _exported DbMemoryException : public DbException
111
 
{
112
 
public:
113
 
        virtual ~DbMemoryException();
114
 
        DbMemoryException(Dbt *dbt);
115
 
        DbMemoryException(const char *description);
116
 
        DbMemoryException(const char *prefix, Dbt *dbt);
117
 
        DbMemoryException(const char *prefix1, const char *prefix2, Dbt *dbt);
118
 
        Dbt *get_dbt() const;
119
 
 
120
 
        DbMemoryException(const DbMemoryException &);
121
 
        DbMemoryException &operator = (const DbMemoryException &);
122
 
 
123
 
private:
124
 
        Dbt *dbt_;
125
 
};
126
 
 
127
 
//
128
 
// A specific sort of exception that occurs when
129
 
// recovery is required before continuing DB activity.
130
 
//
131
 
class _exported DbRunRecoveryException : public DbException
132
 
{
133
 
public:
134
 
        virtual ~DbRunRecoveryException();
135
 
        DbRunRecoveryException(const char *description);
136
 
 
137
 
        DbRunRecoveryException(const DbRunRecoveryException &);
138
 
        DbRunRecoveryException &operator = (const DbRunRecoveryException &);
139
 
};
140
 
 
141
 
#endif /* !_CXX_EXCEPT_H_ */