Main Page
Namespaces
Classes
Files
File List
File Members
build
buildd
coinor-ipopt-3.10.2
Ipopt
contrib
MatlabInterface
src
matlabexception.hpp
Go to the documentation of this file.
1
// Copyright (C) 2007, 2009 Peter Carbonetto. All Rights Reserved.
2
// This code is published under the Eclipse Public License.
3
//
4
// Author: Peter Carbonetto
5
// Dept. of Computer Science
6
// University of British Columbia
7
// May 19, 2007
8
9
#ifndef INCLUDE_MATLABEXCEPTION
10
#define INCLUDE_MATLABEXCEPTION
11
12
#include <exception>
13
14
#define ME_BUFLEN 512
15
16
// Class MatlabException
17
// -----------------------------------------------------------------
18
// It is assumed that the argument passed to the constructor persists
19
// as long as the MatlabException object is in scope. Usually, this
20
// means that it should persist for the duration of the entire
21
// program. This is always the case if the input "message" is a literal.
22
//
23
// AW: Since I would like to include more detailed information (e.g.,
24
// which option is the one that is unknown), I changed this so that
25
// this object keeps a copy of the exception
26
class
MatlabException
:
public
std::exception {
27
public
:
28
MatlabException
(
const
char
*
message
)
throw
();
29
~MatlabException
() throw() { };
30
31
// The copy constructor makes a copy.
32
MatlabException
(
const
MatlabException
& source)
throw
();
33
34
// The copy assignment operator makes a copy as well.
35
MatlabException
&
operator=
(
const
MatlabException
& source);
36
37
// Return the message string.
38
virtual
const
char
*
what
()
const
throw() {
return
message
; };
39
40
private
:
41
char
message[
ME_BUFLEN
];
// The error message.
42
};
43
44
#endif
Generated on Fri Jun 29 2012 06:35:12 by
1.8.1.1