xapian-core  1.4.26
errorhandler.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2003,2006,2007,2012,2013,2014,2016 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_ERRORHANDLER_H
22 #define XAPIAN_INCLUDED_ERRORHANDLER_H
23 
24 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
25 # error "Never use <xapian/errorhandler.h> directly; include <xapian.h> instead."
26 #endif
27 
28 #include <xapian/attributes.h>
29 #include <xapian/deprecated.h>
30 #include <xapian/intrusive_ptr.h>
31 #include <xapian/visibility.h>
32 
33 namespace Xapian {
34 
35 class Error;
36 
53  void operator=(const ErrorHandler &);
54 
57 
77  XAPIAN_DEPRECATED_EX(virtual bool handle_error(Xapian::Error &error)) = 0;
78 
79  public:
81  XAPIAN_NOTHROW(ErrorHandler()) {}
82 
84  virtual ~ErrorHandler();
85 
96  void operator()(Xapian::Error &error);
97 
106  opt_intrusive_base::release();
107  return this;
108  }
109 
117  const ErrorHandler * release() const {
118  opt_intrusive_base::release();
119  return this;
120  }
121 };
122 
123 }
124 
125 #endif /* XAPIAN_INCLUDED_ERRORHANDLER_H */
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
#define XAPIAN_DEPRECATED_EX(D)
Definition: deprecated.h:38
Compiler attribute macros.
Define XAPIAN_DEPRECATED() and related macros.
ErrorHandler * release()
Start reference counting this object.
Definition: errorhandler.h:105
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28
const ErrorHandler * release() const
Start reference counting this object.
Definition: errorhandler.h:117
Decide if a Xapian::Error exception should be ignored.
Definition: errorhandler.h:50
Define XAPIAN_VISIBILITY_* macros.
Base class for objects managed by opt_intrusive_ptr.
ErrorHandler()
Default constructor.
Definition: errorhandler.h:81
All exceptions thrown by Xapian are subclasses of Xapian::Error.
Definition: error.h:43