Commit 87030317 authored by GILLES Sebastien's avatar GILLES Sebastien

#1479 Introduce a 'GracefulExit' exception which should be handled in the main...

#1479 Introduce a 'GracefulExit' exception which should be handled in the main by an EXIT_SUCCESS return code.
parent 9858a2bf
......@@ -585,6 +585,8 @@
BE3D12C31D9B1FFB00F900F5 /* SnesConvergenceReason.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE3D12BD1D9B1FFB00F900F5 /* SnesConvergenceReason.hpp */; };
BE3D12C41D9B1FFB00F900F5 /* SnesConvergenceReason.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE3D12BE1D9B1FFB00F900F5 /* SnesConvergenceReason.hxx */; };
BE3D3AB822F183DA00E7794E /* Enum.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE3D3AB522F183DA00E7794E /* Enum.hpp */; };
BE3D3ABB22F1BBAE00E7794E /* GracefulExit.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE3D3ABA22F1BBAE00E7794E /* GracefulExit.hpp */; };
BE3D3ABC22F1BDA300E7794E /* GracefulExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE3D3AB922F1BB9500E7794E /* GracefulExit.cpp */; };
BE3DA2021F2B817E0005679B /* OutputDeformedMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE93B31C1F0536DA004F84CF /* OutputDeformedMesh.cpp */; };
BE3E66451ACEB61100A3F7E2 /* Partition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE3E66421ACEB61100A3F7E2 /* Partition.cpp */; };
BE3E66461ACEB61100A3F7E2 /* Partition.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE3E66431ACEB61100A3F7E2 /* Partition.hpp */; };
......@@ -3488,6 +3490,8 @@
BE3D12BD1D9B1FFB00F900F5 /* SnesConvergenceReason.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = SnesConvergenceReason.hpp; sourceTree = "<group>"; };
BE3D12BE1D9B1FFB00F900F5 /* SnesConvergenceReason.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = SnesConvergenceReason.hxx; sourceTree = "<group>"; };
BE3D3AB522F183DA00E7794E /* Enum.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Enum.hpp; sourceTree = "<group>"; };
BE3D3AB922F1BB9500E7794E /* GracefulExit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GracefulExit.cpp; sourceTree = "<group>"; };
BE3D3ABA22F1BBAE00E7794E /* GracefulExit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GracefulExit.hpp; sourceTree = "<group>"; };
BE3D8F0E1F6542CB0009DB44 /* demo_input_parameter_test_functions_1D.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_input_parameter_test_functions_1D.lua; sourceTree = "<group>"; };
BE3D8F0F1F6542CB0009DB44 /* demo_input_parameter_test_functions_2D.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_input_parameter_test_functions_2D.lua; sourceTree = "<group>"; };
BE3D8F101F6542CB0009DB44 /* demo_input_parameter_test_functions_3D.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_input_parameter_test_functions_3D.lua; sourceTree = "<group>"; };
......@@ -9491,6 +9495,8 @@
BEA3248717A7E5BA00ADEB73 /* Exception.hpp */,
BEF9835B180451CF00E7905D /* Factory.cpp */,
BEF9835C180451CF00E7905D /* Factory.hpp */,
BE3D3AB922F1BB9500E7794E /* GracefulExit.cpp */,
BE3D3ABA22F1BBAE00E7794E /* GracefulExit.hpp */,
BE4478701AA70A1300665010 /* PrintAndAbort.cpp */,
BE4478711AA70A1300665010 /* PrintAndAbort.hpp */,
BE4478721AA70A1300665010 /* PrintAndAbort.hxx */,
......@@ -10909,6 +10915,7 @@
BE8B675B1CC0F32400312399 /* NumberingSubsetManager.hxx in Headers */,
BE4D0D2E21A2E4F900E0D4E7 /* InitVertexMatching.hpp in Headers */,
BE4D0D1F21A2E4F900E0D4E7 /* ReactionCoefficient.hxx in Headers */,
BE3D3ABB22F1BBAE00E7794E /* GracefulExit.hpp in Headers */,
BE4D0D1821A2E4F900E0D4E7 /* FitzHughNagumo.hpp in Headers */,
BE4D0D4421A2E4F900E0D4E7 /* Heart.hxx in Headers */,
BE4D0D8321A2E4F900E0D4E7 /* InterpolationFile.hpp in Headers */,
......@@ -12602,6 +12609,7 @@
buildActionMask = 2147483647;
files = (
BE4D0D5E21A2E4F900E0D4E7 /* HyperelasticBulk.cpp in Sources */,
BE3D3ABC22F1BDA300E7794E /* GracefulExit.cpp in Sources */,
BE4D0D5F21A2E4F900E0D4E7 /* Solid.cpp in Sources */,
BE7E553B22EF2D0000BEA053 /* Parallelism.cpp in Sources */,
BE4D0D7C21A2E4F900E0D4E7 /* LightweightDomainList.cpp in Sources */,
/*!
//
// \file
//
// \ingroup UtilitiesGroup
// \addtogroup UtilitiesGroup
// \{
*/
#include <sstream>
#include "Utilities/Exceptions/GracefulExit.hpp"
namespace MoReFEM::ExceptionNS
{
GracefulExit::GracefulExit(const char* invoking_file, int invoking_line)
: MoReFEM::Exception("The code will stop now and return EXIT_SUCCESS", invoking_file, invoking_line)
{ }
GracefulExit::~GracefulExit() = default;
} // namespace MoReFEM::ExceptionNS
/// @} // addtogroup UtilitiesGroup
/*!
//
// \file
//
//
// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Tue, 8 Oct 2013 13:37:25 +0200
// Copyright (c) Inria. All rights reserved.
//
// \ingroup UtilitiesGroup
// \addtogroup UtilitiesGroup
// \{
*/
#ifndef MOREFEM_x_UTILITIES_x_EXCEPTIONS_x_GRACEFUL_EXIT_HPP_
# define MOREFEM_x_UTILITIES_x_EXCEPTIONS_x_GRACEFUL_EXIT_HPP_
# include "Utilities/Exceptions/Exception.hpp"
namespace MoReFEM::ExceptionNS
{
//! Exception when we want to exit gracefull with a EXIT_SUCCESS return code.
class GracefulExit : public MoReFEM::Exception
{
public:
/*!
* \brief Constructor with simple message.
*
* \param[in] invoking_file File that invoked the function or class; usually __FILE__.
* \param[in] invoking_line File that invoked the function or class; usually __LINE__.
*/
explicit GracefulExit(const char* invoking_file, int invoking_line);
//! \copydoc doxygen_hide_copy_constructor
GracefulExit(const GracefulExit& rhs) = default;
//! \copydoc doxygen_hide_move_constructor
GracefulExit(GracefulExit&& rhs) = default;
//! \copydoc doxygen_hide_copy_affectation
GracefulExit& operator=(const GracefulExit& rhs) = default;
//! \copydoc doxygen_hide_move_affectation
GracefulExit& operator=(GracefulExit&& rhs) = default;
//! Destructor
virtual ~GracefulExit() override;
};
} // namespace MoReFEM::ExceptionNS
/// @} // addtogroup UtilitiesGroup
#endif // MOREFEM_x_UTILITIES_x_EXCEPTIONS_x_GRACEFUL_EXIT_HPP_
......@@ -12,11 +12,13 @@ target_sources(${MOREFEM_UTILITIES}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Exception.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Factory.cpp"
"${CMAKE_CURRENT_LIST_DIR}/GracefulExit.cpp"
"${CMAKE_CURRENT_LIST_DIR}/PrintAndAbort.cpp"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Exception.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Factory.hpp"
"${CMAKE_CURRENT_LIST_DIR}/GracefulExit.hpp"
"${CMAKE_CURRENT_LIST_DIR}/PrintAndAbort.hpp"
"${CMAKE_CURRENT_LIST_DIR}/PrintAndAbort.hxx"
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment