ProteoWizard
pwiz
analysis
demux
EnumConstantNotPresentException.hpp
Go to the documentation of this file.
1
//
2
// $Id$
3
//
4
//
5
// Original author: Austin Keller <atkeller .@. uw.edu>
6
//
7
// Licensed under the Apache License, Version 2.0 (the "License");
8
// you may not use this file except in compliance with the License.
9
// You may obtain a copy of the License at
10
//
11
// http://www.apache.org/licenses/LICENSE-2.0
12
//
13
// Unless required by applicable law or agreed to in writing, software
14
// distributed under the License is distributed on an "AS IS" BASIS,
15
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
// See the License for the specific language governing permissions and
17
// limitations under the License.
18
//
19
20
#ifndef _ENUMCONSTANTNOTPRESENTEXCEPTION_HPP
21
#define _ENUMCONSTANTNOTPRESENTEXCEPTION_HPP
22
23
#include "
pwiz/utility/misc/Std.hpp
"
24
25
/// An exception class inspired by Java's EnumConstantNotPresentException.
26
class
EnumConstantNotPresentException
:
public
std::runtime_error
27
{
28
public
:
29
/// Constructor with string message
30
explicit
EnumConstantNotPresentException
(
const
std::string& _Message)
31
: runtime_error(_Message) {}
32
33
/// Constructor with char* message
34
explicit
EnumConstantNotPresentException
(
const
char
* _Message)
35
: runtime_error(_Message) {}
36
37
/// Required override of destructor for std::exception
38
~EnumConstantNotPresentException
() throw()
override
{}
39
40
/// Provides descriptive message of error
41
const
char
*
what
()
const
throw()
override
42
{
43
return
"Attempted to access enum by name that is not present"
;
44
}
45
};
46
#endif
EnumConstantNotPresentException
An exception class inspired by Java's EnumConstantNotPresentException.
Definition:
EnumConstantNotPresentException.hpp:27
EnumConstantNotPresentException::EnumConstantNotPresentException
EnumConstantNotPresentException(const std::string &_Message)
Constructor with string message.
Definition:
EnumConstantNotPresentException.hpp:30
EnumConstantNotPresentException::~EnumConstantNotPresentException
~EnumConstantNotPresentException() override
Required override of destructor for std::exception.
Definition:
EnumConstantNotPresentException.hpp:38
Std.hpp
EnumConstantNotPresentException::EnumConstantNotPresentException
EnumConstantNotPresentException(const char *_Message)
Constructor with char* message.
Definition:
EnumConstantNotPresentException.hpp:34
EnumConstantNotPresentException::what
const char * what() const override
Provides descriptive message of error.
Definition:
EnumConstantNotPresentException.hpp:41
Generated by
1.8.20