Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/MsqFPE.hpp
Go to the documentation of this file.
1 /* *****************************************************************
2  MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4  Copyright 2005 Lawrence Livermore National Laboratory. Under
5  the terms of Contract B545069 with the University of Wisconsin --
6  Madison, Lawrence Livermore National Laboratory retains certain
7  rights in this software.
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  (lgpl.txt) along with this library; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 
23  kraftche@cae.wisc.edu
24 
25  ***************************************************************** */
26 
27 #ifndef MSQ_FPE_HPP
28 #define MSQ_FPE_HPP
29 
30 #include <sys/types.h>
31 
32 namespace Mesquite {
33 
48 class MsqFPE
49 {
50 public:
51 
58  MsqFPE( bool enabled );
59 
61  ~MsqFPE();
62 
64  static bool fpe_trap_supported();
66  static int get_current_fpe_state();
68  static void set_current_fpe_state(int state);
70  static void enable_trap_fpe();
71 
72 private:
73 
75  void* operator new(size_t);
77  MsqFPE( const MsqFPE& );
79  MsqFPE& operator=( const MsqFPE& );
80 
82  bool isEnabled;
84  int prevState;
85 };
86 
87 } // namespace Mesquite
88 
89 #endif
90 
static void enable_trap_fpe()
bool isEnabled
Saved constructor argument for use in destructor.
static void set_current_fpe_state(int state)
MsqFPE(bool enabled)
Set FPE state.
Utility class used by InstructionQueue SIGFPE option.
MsqFPE & operator=(const MsqFPE &)
dummy declaration preventing default assignment operator
int prevState
Saved FPE state for use in destructor.
static bool fpe_trap_supported()
Check if FPE state manipulation is supported on this platform.
static int get_current_fpe_state()
~MsqFPE()
Restore FPE state.