Blender  V2.93
Exception.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
24 #ifdef WITH_CXX_GUARDEDALLOC
25 # include "MEM_guardedalloc.h"
26 #endif
27 
28 namespace Freestyle {
29 
30 class Exception {
31  public:
32  typedef enum {
36 
37  static int getException()
38  {
39  exception_type e = _exception;
40  _exception = NO_EXCEPTION;
41  return e;
42  }
43 
44  static int raiseException(exception_type exception = UNDEFINED)
45  {
46  _exception = exception;
47  return _exception;
48  }
49 
50  static void reset()
51  {
52  _exception = NO_EXCEPTION;
53  }
54 
55  private:
56  static exception_type _exception;
57 
58 #ifdef WITH_CXX_GUARDEDALLOC
59  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Exception")
60 #endif
61 };
62 
63 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
static void reset()
Definition: Exception.h:50
static int getException()
Definition: Exception.h:37
static int raiseException(exception_type exception=UNDEFINED)
Definition: Exception.h:44
inherits from class Rep
Definition: AppCanvas.cpp:32