casacore
Loading...
Searching...
No Matches
FunctionFactoryErrors.h
Go to the documentation of this file.
1// # FunctionFactoryErrors: Exception classes for use by FunctionFactories & clients
2// # Copyright (C) 2002
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef SCIMATH_FUNCTIONFACTORYERRORS_H
27#define SCIMATH_FUNCTIONFACTORYERRORS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Exceptions/Error.h>
31
32namespace casacore { // # NAMESPACE CASACORE - BEGIN
33
35 public:
37 virtual ~FunctionFactoryError() noexcept;
38};
39
41 public:
42 // create an exception indicating that the a function of the given name
43 // is not recognized
46 virtual ~UnrecognizedFunctionError() noexcept;
47
48 const String& getName() { return fname; }
49
50 private:
52};
53
55 public:
56 // create an exception indicating a Record serialization of a
57 // Function is invalid. The error message will be a "Invalid function
58 // description in record: " + reason.
60 : FunctionFactoryError(preamble + reason, c), reas(reason) {}
61
62 virtual ~InvalidSerializationError() noexcept;
63 const String& getReason() { return reas; }
64
65 static const String preamble;
66
67 private:
69};
70
72 public:
74 : InvalidSerializationError(String("No ") + field + " defined", c), fname(field) {}
75 virtual ~FieldNotFoundError() noexcept;
76
77 private:
79};
80
81} // namespace casacore
82
83#endif
AipsError(const Char *str, Category c=GENERAL)
Creates an AipsError and initializes the error message from the parameter.
virtual ~FieldNotFoundError() noexcept
FieldNotFoundError(const String &field, Category c=GENERAL)
FunctionFactoryError(const String &message, Category c=GENERAL)
virtual ~FunctionFactoryError() noexcept
InvalidSerializationError(const String &reason, Category c=GENERAL)
create an exception indicating a Record serialization of a Function is invalid.
virtual ~InvalidSerializationError() noexcept
String: the storage and methods of handling collections of characters.
Definition String.h:355
virtual ~UnrecognizedFunctionError() noexcept
UnrecognizedFunctionError(const String &name, Category c=INVALID_ARGUMENT)
create an exception indicating that the a function of the given name is not recognized
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
String name() const
Return the name of the field.