Commit 6ffa8e97 authored by Emmanuel Promayon's avatar Emmanuel Promayon

UPDATED modernize use noexcept instead of throw

parent ff5883b8
......@@ -44,7 +44,7 @@
using namespace camitk;
// --------------- Constructor -------------------
DicomComponent::DicomComponent(DicomSerie* dicomSerie) throw(AbortException) : ImageComponent("") {
DicomComponent::DicomComponent(DicomSerie* dicomSerie) noexcept : ImageComponent("") {
// associated the component's dicom series
serie = dicomSerie;
......
......@@ -52,7 +52,7 @@ QStringList DicomComponentExtension::getFileExtensions() const {
}
// --------------- Open -------------------
Component* DicomComponentExtension::open(const QString& path) throw (AbortException) {
Component* DicomComponentExtension::open(const QString& path) noexcept {
serieParsed = DicomParser::parseDirectory(path);
......
......@@ -45,7 +45,7 @@ using namespace camitk;
#include <Log.h>
// -------------------- constructor --------------------
ItkImageComponent::ItkImageComponent(const QString& fileName) throw(AbortException)
ItkImageComponent::ItkImageComponent(const QString& fileName) noexcept
: ImageComponent(fileName) {
createComponent(fileName);
}
......
......@@ -47,7 +47,7 @@ using namespace camitk;
#include <QDockWidget>
// -------------------- default constructor --------------------
MMLComponent::MMLComponent(const QString& fileName) throw(AbortException) : Component(fileName, QFileInfo(fileName).baseName()) {
MMLComponent::MMLComponent(const QString& fileName) noexcept : Component(fileName, QFileInfo(fileName).baseName()) {
QString file = fileName;
QFileInfo fi = QFileInfo(fileName);
......
......@@ -71,7 +71,7 @@
using namespace camitk;
//-------------------- Constructor -------------------
PMLComponent::PMLComponent(const QString& file) throw (AbortException) : MeshComponent(file) {
PMLComponent::PMLComponent(const QString& file) noexcept(false) : MeshComponent(file) {
// Open the .pml file using library-pml
try {
Application::showStatusBarMessage("Loading " + QFileInfo(file).fileName() + "...");
......
......@@ -55,7 +55,7 @@ PhysicalModel::PhysicalModel() {
init();
}
PhysicalModel::PhysicalModel ( const char* fileName, PtrToSetProgressFunction pspf ) throw ( PMLAbortException ) {
PhysicalModel::PhysicalModel ( const char* fileName, PtrToSetProgressFunction pspf ) noexcept(false) {
init();
setProgressFunction = pspf;
......@@ -329,7 +329,7 @@ void PhysicalModel::xmlPrint ( std::ostream& o, bool opt ) {
}
// --------------- xmlRead ---------------
void PhysicalModel::xmlRead ( const char* filename ) throw ( PMLAbortException ) {
void PhysicalModel::xmlRead ( const char* filename ) noexcept(false) {
// clear all the current data
clear();
......
......@@ -47,7 +47,7 @@ using namespace camitk;
#include "ActionTransition.h"
// ---------------------- constructor ----------------------------
ActionStateMachine::ActionStateMachine(int& argc, char** argv, QString inputFileName, QString outputDirectory) throw(AbortException) :
ActionStateMachine::ActionStateMachine(int& argc, char** argv, QString inputFileName, QString outputDirectory) noexcept :
Application("camitk-actionstatemachine", argc, argv) {
setProperty("Log to File", true);
......@@ -176,7 +176,7 @@ void ActionStateMachine::initMainWindow() {
}
// ---------------------- checkSCXMLFile ----------------------------
void ActionStateMachine::checkSCXMLFile(QString filename) throw (AbortException) {
void ActionStateMachine::checkSCXMLFile(QString filename) noexcept {
QString msg;
QDomDocument doc;
......@@ -210,7 +210,7 @@ void ActionStateMachine::checkSCXMLFile(QString filename) throw (AbortException)
}
// ---------------------- parseSCXMLTree ----------------------------
QString ActionStateMachine::parseSCXMLTree() throw(AbortException) {
QString ActionStateMachine::parseSCXMLTree() noexcept {
// Get the name of the application
QString applicationName = "";
QDomElement docElem = scxmlDoc.documentElement();
......@@ -261,7 +261,7 @@ void ActionStateMachine::finished() {
}
// ---------------------- createAllActionStates ----------------------------
void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) throw(AbortException) {
void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) noexcept {
int nbStates = nodeList.size();
if (nbStates < 1) {
QString msg = tr("No state and no camitk-action!");
......@@ -348,7 +348,7 @@ void ActionStateMachine::createAllActionStates(QDomNodeList nodeList) throw(Abor
}
// ---------------------- createTransitions ----------------------------
void ActionStateMachine::createTransitions(QDomNodeList nodeList) throw(AbortException) {
void ActionStateMachine::createTransitions(QDomNodeList nodeList) noexcept {
int nbStates = nodeList.size();
for (int stateNumber = 0; stateNumber < nbStates; stateNumber++) {
// For each state ...
......@@ -448,7 +448,7 @@ QVector<Action::ApplyStatus> ActionStateMachine::stringToStatus(QString listOfSt
}
// ---------------------- setCamiTKAction ----------------------------
void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement actionElement) throw (AbortException) {
void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement actionElement) noexcept {
QString msg;
if ((actionState == nullptr) || (actionElement.isNull())) {
msg = tr("No Action or no state...");
......@@ -535,7 +535,7 @@ void ActionStateMachine::setCamiTKAction(ActionState* actionState, QDomElement a
}
// ---------------------- setCamiTKSaveAction ----------------------------
void ActionStateMachine::setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement) throw (AbortException) {
void ActionStateMachine::setCamiTKSaveAction(SaveActionState* actionState, QDomElement actionElement) noexcept {
QString msg;
if ((actionState == nullptr) || (actionElement.isNull())) {
......
......@@ -16,7 +16,7 @@ namespace cli
// unknown_option
//
unknown_option::
~unknown_option () throw ()
~unknown_option () noexcept
{
}
......@@ -27,7 +27,7 @@ namespace cli
}
const char* unknown_option::
what () const throw ()
what () const noexcept
{
return "unknown option";
}
......@@ -35,7 +35,7 @@ namespace cli
// unknown_argument
//
unknown_argument::
~unknown_argument () throw ()
~unknown_argument () noexcept
{
}
......@@ -46,7 +46,7 @@ namespace cli
}
const char* unknown_argument::
what () const throw ()
what () const noexcept
{
return "unknown argument";
}
......@@ -54,7 +54,7 @@ namespace cli
// missing_value
//
missing_value::
~missing_value () throw ()
~missing_value () noexcept
{
}
......@@ -65,7 +65,7 @@ namespace cli
}
const char* missing_value::
what () const throw ()
what () const noexcept
{
return "missing option value";
}
......@@ -73,7 +73,7 @@ namespace cli
// invalid_value
//
invalid_value::
~invalid_value () throw ()
~invalid_value () noexcept
{
}
......@@ -85,7 +85,7 @@ namespace cli
}
const char* invalid_value::
what () const throw ()
what () const noexcept
{
return "invalid option value";
}
......@@ -99,7 +99,7 @@ namespace cli
}
const char* eos_reached::
what () const throw ()
what () const noexcept
{
return "end of argument stream reached";
}
......
......@@ -16,7 +16,7 @@ namespace cli
// unknown_option
//
unknown_option::
~unknown_option () throw ()
~unknown_option () noexcept
{
}
......@@ -27,7 +27,7 @@ namespace cli
}
const char* unknown_option::
what () const throw ()
what () const noexcept
{
return "unknown option";
}
......@@ -35,7 +35,7 @@ namespace cli
// unknown_argument
//
unknown_argument::
~unknown_argument () throw ()
~unknown_argument () noexcept
{
}
......@@ -46,7 +46,7 @@ namespace cli
}
const char* unknown_argument::
what () const throw ()
what () const noexcept
{
return "unknown argument";
}
......@@ -54,7 +54,7 @@ namespace cli
// missing_value
//
missing_value::
~missing_value () throw ()
~missing_value () noexcept
{
}
......@@ -65,7 +65,7 @@ namespace cli
}
const char* missing_value::
what () const throw ()
what () const noexcept
{
return "missing option value";
}
......@@ -73,7 +73,7 @@ namespace cli
// invalid_value
//
invalid_value::
~invalid_value () throw ()
~invalid_value () noexcept
{
}
......@@ -85,7 +85,7 @@ namespace cli
}
const char* invalid_value::
what () const throw ()
what () const noexcept
{
return "invalid option value";
}
......@@ -99,7 +99,7 @@ namespace cli
}
const char* eos_reached::
what () const throw ()
what () const noexcept
{
return "end of argument stream reached";
}
......
......@@ -16,7 +16,7 @@ namespace cli
// unknown_option
//
unknown_option::
~unknown_option () throw ()
~unknown_option () noexcept
{
}
......@@ -27,7 +27,7 @@ namespace cli
}
const char* unknown_option::
what () const throw ()
what () const noexcept
{
return "unknown option";
}
......@@ -35,7 +35,7 @@ namespace cli
// unknown_argument
//
unknown_argument::
~unknown_argument () throw ()
~unknown_argument () noexcept
{
}
......@@ -46,7 +46,7 @@ namespace cli
}
const char* unknown_argument::
what () const throw ()
what () const noexcept
{
return "unknown argument";
}
......@@ -54,7 +54,7 @@ namespace cli
// missing_value
//
missing_value::
~missing_value () throw ()
~missing_value () noexcept
{
}
......@@ -65,7 +65,7 @@ namespace cli
}
const char* missing_value::
what () const throw ()
what () const noexcept
{
return "missing option value";
}
......@@ -73,7 +73,7 @@ namespace cli
// invalid_value
//
invalid_value::
~invalid_value () throw ()
~invalid_value () noexcept
{
}
......@@ -85,7 +85,7 @@ namespace cli
}
const char* invalid_value::
what () const throw ()
what () const noexcept
{
return "invalid option value";
}
......@@ -99,7 +99,7 @@ namespace cli
}
const char* eos_reached::
what () const throw ()
what () const noexcept
{
return "end of argument stream reached";
}
......
......@@ -16,7 +16,7 @@ namespace cli
// unknown_option
//
unknown_option::
~unknown_option () throw ()
~unknown_option () noexcept
{
}
......@@ -27,7 +27,7 @@ namespace cli
}
const char* unknown_option::
what () const throw ()
what () const noexcept
{
return "unknown option";
}
......@@ -35,7 +35,7 @@ namespace cli
// unknown_argument
//
unknown_argument::
~unknown_argument () throw ()
~unknown_argument () noexcept
{
}
......@@ -46,7 +46,7 @@ namespace cli
}
const char* unknown_argument::
what () const throw ()
what () const noexcept
{
return "unknown argument";
}
......@@ -54,7 +54,7 @@ namespace cli
// missing_value
//
missing_value::
~missing_value () throw ()
~missing_value () noexcept
{
}
......@@ -65,7 +65,7 @@ namespace cli
}
const char* missing_value::
what () const throw ()
what () const noexcept
{
return "missing option value";
}
......@@ -73,7 +73,7 @@ namespace cli
// invalid_value
//
invalid_value::
~invalid_value () throw ()
~invalid_value () noexcept
{
}
......@@ -85,7 +85,7 @@ namespace cli
}
const char* invalid_value::
what () const throw ()
what () const noexcept
{
return "invalid option value";
}
......@@ -99,7 +99,7 @@ namespace cli
}
const char* eos_reached::
what () const throw ()
what () const noexcept
{
return "end of argument stream reached";
}
......
......@@ -16,7 +16,7 @@ namespace cli
// unknown_option
//
unknown_option::
~unknown_option () throw ()
~unknown_option () noexcept
{
}
......@@ -27,7 +27,7 @@ namespace cli
}
const char* unknown_option::
what () const throw ()
what () const noexcept
{
return "unknown option";
}
......@@ -35,7 +35,7 @@ namespace cli
// unknown_argument
//
unknown_argument::
~unknown_argument () throw ()
~unknown_argument () noexcept
{
}
......@@ -46,7 +46,7 @@ namespace cli
}
const char* unknown_argument::
what () const throw ()
what () const noexcept
{
return "unknown argument";
}
......@@ -54,7 +54,7 @@ namespace cli
// missing_value
//
missing_value::
~missing_value () throw ()
~missing_value () noexcept
{
}
......@@ -65,7 +65,7 @@ namespace cli
}
const char* missing_value::
what () const throw ()
what () const noexcept
{
return "missing option value";
}
......@@ -73,7 +73,7 @@ namespace cli
// invalid_value
//
invalid_value::
~invalid_value () throw ()
~invalid_value () noexcept
{
}
......@@ -85,7 +85,7 @@ namespace cli
}
const char* invalid_value::
what () const throw ()
what () const noexcept
{
return "invalid option value";
}
......@@ -99,7 +99,7 @@ namespace cli
}
const char* eos_reached::
what () const throw ()
what () const noexcept
{
return "end of argument stream reached";
}
......
......@@ -16,7 +16,7 @@ namespace cli
// unknown_option
//
unknown_option::
~unknown_option () throw ()
~unknown_option () noexcept
{
}
......@@ -27,7 +27,7 @@ namespace cli
}
const char* unknown_option::
what () const throw ()
what () const noexcept
{
return "unknown option";
}
......@@ -35,7 +35,7 @@ namespace cli
// unknown_argument
//
unknown_argument::
~unknown_argument () throw ()
~unknown_argument () noexcept
{
}
......@@ -46,7 +46,7 @@ namespace cli
}
const char* unknown_argument::
what () const throw ()
what () const noexcept
{
return "unknown argument";
}
......@@ -54,7 +54,7 @@ namespace cli
// missing_value
//
missing_value::
~missing_value () throw ()
~missing_value () noexcept
{
}
......@@ -65,7 +65,7 @@ namespace cli
}
const char* missing_value::
what () const throw ()
what () const noexcept
{
return "missing option value";
}
......@@ -73,7 +73,7 @@ namespace cli
// invalid_value
//
invalid_value::
~invalid_value () throw ()
~invalid_value () noexcept
{
}
......@@ -85,7 +85,7 @@ namespace cli
}
const char* invalid_value::
what () const throw ()
what () const noexcept
{
return "invalid option value";
}
......@@ -99,7 +99,7 @@ namespace cli
}
const char* eos_reached::
what () const throw ()
what () const noexcept
{
return "end of argument stream reached";
}
......
......@@ -16,7 +16,7 @@ namespace cli
// unknown_option
//
unknown_option::
~unknown_option () throw ()
~unknown_option () noexcept
{
}
......@@ -27,7 +27,7 @@ namespace cli
}
const char* unknown_option::
what () const throw ()
what () const noexcept
{
return "unknown option";
}
......@@ -35,7 +35,7 @@ namespace cli
// unknown_argument
//
unknown_argument::
~unknown_argument () throw ()
~unknown_argument () noexcept
{
}
......@@ -46,7 +46,7 @@ namespace cli
}
const char* unknown_argument::
what () const throw ()
what () const noexcept
{
return "unknown argument";
}
......@@ -54,7 +54,7 @@ namespace cli
// missing_value
//
missing_value::
~missing_value () throw ()
~missing_value () noexcept
{
}
......@@ -65,7 +65,7 @@ namespace cli
}
const char* missing_value::
what () const throw ()
what () const noexcept
{
return "missing option value";
}
......@@ -73,7 +73,7 @@ namespace cli
// invalid_value
//
invalid_value::
~invalid_value () throw ()
~invalid_value () noexcept
{
}
......@@ -85,7 +85,7 @@ namespace cli
}
const char* invalid_value::
what () const throw ()
what () const noexcept
{
return "invalid option value";
}
......@@ -99,7 +99,7 @@ namespace cli
}
const char* eos_reached::
what () const throw ()
what () const noexcept
{
return "end of argument stream reached";
}
......
......@@ -36,7 +36,7 @@
using namespace camitk;
// --------------- Constructor -------------------
StlComponent::StlComponent(const QString& file) throw(AbortException): MeshComponent(file) {
StlComponent::StlComponent(const QString& file) noexcept: MeshComponent(file) {
// use the file name without extension as component name
setName(QFileInfo(file).baseName());
......
......@@ -38,7 +38,7 @@
using namespace camitk;
// -------------------- default constructor --------------------
VRMLComponent::VRMLComponent(const QString& file) throw(AbortException) : Component(file, QFileInfo(file).baseName()) {
VRMLComponent::VRMLComponent(const QString& file) noexcept : Component(file, QFileInfo(file).baseName()) {
// create a VTK importer to read the VRML file
vtkSmartPointer<vtkVRMLImporter> importer = vtkSmartPointer<vtkVRMLImporter>::New();
......
......@@ -32,7 +32,7 @@
using namespace camitk;
// -------------------- constructor --------------------
RawImageComponent::RawImageComponent(const QString& fileName) throw(AbortException)
RawImageComponent::RawImageComponent(const QString& fileName) noexcept
: ImageComponent(fileName) {
if (!fileName.isNull()) {
// restore the normal cursor
......
......@@ -48,13 +48,13 @@
using namespace camitk;
// -------------------- constructor --------------------
VtkImageComponent::VtkImageComponent(const QString& fileName) throw(AbortException)
VtkImageComponent::VtkImageComponent(const QString& fileName) noexcept
: ImageComponent(fileName) {
createComponent(fileName);
}
// -------------------- createComponent --------------------
void VtkImageComponent::createComponent(const QString& filename) throw (camitk::AbortException) {
void VtkImageComponent::createComponent(const QString& filename) noexcept {
if (!filename.isNull()) {
try {
// create the ImageComponent (it will register it self in the list of Components)
......
......@@ -49,7 +49,7 @@ Component::Component(const QString& file, const QString& n, Representation s) :
}
Component::Component(Component* parentComponent, const QString& n, Representation s)throw(AbortException) : myParentNode(parentComponent), myService(s), myName(n) {
Component::Component(Component* parentComponent, const QString& n, Representation s)noexcept(false) : myParentNode(parentComponent), myService(s), myName(n) {
if (myParentNode == nullptr) {