MAiNGO
MAiNGOMpiException.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  **********************************************************************************/
11 
12 #ifdef HAVE_MAiNGO_MPI
13 #pragma once
14 
15 #include "MAiNGOException.h"
16 #include "babNode.h"
17 
18 
19 namespace maingo {
20 
21 
31 class MAiNGOMpiException: public MAiNGOException {
32 
33  public:
34  MAiNGOMpiException() = delete;
35  MAiNGOMpiException(const MAiNGOMpiException&) = default;
36  MAiNGOMpiException(MAiNGOMpiException&&) = default;
37  MAiNGOMpiException& operator=(const MAiNGOMpiException&) = default;
38  MAiNGOMpiException& operator=(MAiNGOMpiException&&) = default;
39  ~MAiNGOMpiException() = default;
40 
41  enum ORIGIN {
42  ORIGIN_ME = 1,
43  ORIGIN_OTHER
44  };
45 
46  MAiNGOMpiException(const std::string& errorMessage, const ORIGIN origin):
47  MAiNGOException(errorMessage), _origin(origin)
48  {
49  }
50 
51  MAiNGOMpiException(const std::string& errorMessage, const babBase::BabNode& nodeThatProblemOccurredIn, const ORIGIN origin):
52  MAiNGOException(errorMessage, nodeThatProblemOccurredIn), _origin(origin)
53  {
54  }
55 
56  MAiNGOMpiException(const std::string& errorMessage, const std::exception& originalException, const ORIGIN origin):
57  MAiNGOException(errorMessage, originalException), _origin(origin)
58  {
59  }
60 
61  MAiNGOMpiException(const std::string& errorMessage, const std::exception& originalException, const babBase::BabNode& nodeThatProblemOccurredIn, const ORIGIN origin):
62  MAiNGOException(errorMessage, originalException, nodeThatProblemOccurredIn), _origin(origin)
63  {
64  }
65 
66  MAiNGOMpiException(MAiNGOException& originalException, ORIGIN origin):
67  MAiNGOException(originalException), _origin(origin)
68  {
69  }
70 
71  ORIGIN origin() const noexcept { return _origin; }
72 
73  private:
74  ORIGIN _origin;
75 };
76 
77 
78 } // end namespace maingo
79 #endif
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25