Loading...
Searching...
No Matches
TableError.h
Go to the documentation of this file.
//# TableError.h: Table error classes
//# Copyright (C) 1994,1995,1996,1997,1999,2000
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef TABLES_TABLEERROR_H
#define TABLES_TABLEERROR_H
//# Includes
#include <casacore/casa/aips.h>
#include <casacore/casa/Exceptions/Error.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
//# Forward Declarations.
class IPosition;
//# This header file defines the error classes belonging to the table
//# descriptor class and its associated classes.
// <summary>
// Base error class for storage manager
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// This is the generic StMan exception; catching this one means catching
// all Table* exceptions.
// Note that you have to catch AipsError to catch all possible exceptions.
// </synopsis>
class TableError : public AipsError {
public:
// The default constructor generates the message "Table error".
TableError (Category c=GENERAL);
// Construct with given message.
TableError (const String& message,Category c=GENERAL);
~TableError () noexcept;
};
// <summary>
// Internal table error
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Internal table error (should never be thrown).
// If this is thrown, something is terribly wrong.
// </synopsis>
class TableInternalError : public TableError {
public:
// Add given message to string "Internal Table error: ".
TableInternalError (const String& message,Category c=GENERAL);
~TableInternalError () noexcept;
};
// <summary>
// Table error; table (description) already exists
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Table (description) with this name already exists.
// </synopsis>
class TableDuplFile : public TableError {
public:
// This constructor generates a message telling that the a table
// or description with the given name already exists.
TableDuplFile (const String& name, Category c=INVALID_ARGUMENT);
// This constructor generates a message telling that the a table
// or description with the given name already exists.
// The given message is appended to it.
TableDuplFile (const String& name, const String& message,Category c=INVALID_ARGUMENT);
~TableDuplFile () noexcept;
};
// <summary>
// Table error; table (description) not found
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Table (description) with this name could not be found.
// </synopsis>
class TableNoFile : public TableError {
public:
// This constructor generates a message telling that the a table
// or description with the given name does not exist.
TableNoFile (const String& name,Category c=INVALID_ARGUMENT);
~TableNoFile () noexcept;
};
// <summary>
// Table error; no name given to table description
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// No name given for the table description.
// Only scratch descriptions can have no name (i.e. a blank name).
// </synopsis>
class TableDescNoName : public TableError {
public:
// The default constructor generates the message.
TableDescNoName (Category c=INITIALIZATION);
~TableDescNoName () noexcept;
};
// <summary>
// Table error; invalid table (description) option
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Invalid Table(Desc) option given for the table (description).
// </synopsis>
class TableInvOpt : public TableError {
public:
// This constructor generates a message that an invalid option
// has been given. The class name is either Table or TableDesc.
// The given message will be appended to the total message.
TableInvOpt (const String& className, const String& message,Category c=INVALID_ARGUMENT);
~TableInvOpt () noexcept;
};
// Table error; path is not a directory
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Table directory with this name could not be found.
// </synopsis>
class TableNoDir : public TableError {
public:
// This constructor generates a message telling that the
// table directory with the given name does not exist.
TableNoDir (const String& name,Category c=INVALID_ARGUMENT);
~TableNoDir () noexcept;
};
// <summary>
// Table error; table.dat file not found
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// The table.dat file for this table could not be found.
// </synopsis>
class TableNoDatFile : public TableError {
public:
// This constructor generates a message telling that the a table
// or datription file does not exist.
TableNoDatFile (const String& filename,Category c=INVALID_ARGUMENT);
~TableNoDatFile () noexcept;
};
// <summary>
// Table error; table type mismatch
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// The given table type (i.e. name of the table description) does
// not match the type as stored in the table file.
// </synopsis>
class TableInvType : public TableError {
public:
// This constructor generates a message that the in table type
// mismatches the table type in the file.
TableInvType (const String& tablename,
const String& typeIn, const String& typeFile,
Category c=CONFORMANCE);
~TableInvType () noexcept;
};
// <summary>
// Table error; invalid column description
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// The description of a column is invalid.
// The given default manager is unknown
// (i.e. not registered in DataManReg.cc).
// </synopsis>
class TableInvColumnDesc : public TableError {
public:
// This constructor generates a message that the column
// with the given name has an invalid description.
TableInvColumnDesc (const String& columnName, const String& message,Category c=INVALID_ARGUMENT);
~TableInvColumnDesc () noexcept;
};
// <summary>
// Table error; invalid hypercolumn description
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// The description of a hypercolumn is invalid.
// The referenced columns are unknown or invalid.
// The message explains the reason.
// </synopsis>
class TableInvHyperDesc : public TableError {
public:
// This constructor generates a message that the hypercolumn
// with the given name has an invalid description.
TableInvHyperDesc (const String& hypercolumnName, const String& message,Category c=INVALID_ARGUMENT);
~TableInvHyperDesc () noexcept;
};
// <summary>
// Table error; unknown column description
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// To be able to reconstruct the correct column description object
// from a stored table description, each column description type
// must register itself (see ColumnDesc.h and ColumnReg.cc).
// </synopsis>
class TableUnknownDesc : public TableError {
public:
// This constructor generates a message that the class with the
// given name is unknown (not registered).
TableUnknownDesc (const String& name,Category c=INITIALIZATION);
~TableUnknownDesc () noexcept;
};
// <summary>
// Table error; invalid data type
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Checking of the data type of a column is done at runtime.
// This error results from non-matching data types when constructing
// a ScalarColumn or ArrayColumn or from invalid data type promotions
// when doing a get or put.
// </synopsis>
class TableInvDT : public TableError {
public:
// The default constructor generates a generic "invalid data type" message.
TableInvDT (Category c=CONFORMANCE);
// Put the name of the offending column in the "invalid data type" message.
TableInvDT (const String& columName,Category c=CONFORMANCE);
~TableInvDT () noexcept;
};
// <summary>
// Table error; invalid operation
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Invalid operation on a table.
// A request was done that could not be handled by the table system
// (e.g. sorting on a column containing arrays).
// The message tells what is wrong.
// </synopsis>
// Invalid operation on a table.
class TableInvOper : public TableError {
public:
// The default constructor generates a generic "invalid operation" message.
TableInvOper (Category c=INVALID_ARGUMENT);
// Add given message to string "Invalid Table operation: ".
TableInvOper (const String& message,Category c=INVALID_ARGUMENT);
~TableInvOper () noexcept;
};
// <summary>
// Table error; non-conformant array
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// When putting a direct array, the shape of the array must conform
// the shape as defined for the table array.
// When getting an array, the receiving array must be zero-length
// or it must conform the shape of the table array.
// </synopsis>
class TableArrayConformanceError : public TableError {
public:
// This constructor appends ": Table array conformance error"
// to the given message.
TableArrayConformanceError (const String& message,Category c=CONFORMANCE);
// This constructor appends ": Table array conformance error"
// to the given message with the given and expected shape.
TableArrayConformanceError (const String& message,
const IPosition& shape,
const IPosition& expectedShape,
Category c=CONFORMANCE);
~TableArrayConformanceError () noexcept;
};
// <summary>
// Table error; table length conformance error
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// When putting a column, the length of the vector must match the
// length of the table (i.e. its number of rows).
// When getting a column, the length of the vector must be zero or
// it must match the length of the table.
// </synopsis>
class TableConformanceError : public TableError {
public:
// This constructor appends ": Table conformance error (#rows mismatch)"
// to the given message.
TableConformanceError (const String& message,Category c=CONFORMANCE);
~TableConformanceError () noexcept;
};
// <summary>
// Table error; invalid sort
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Invalid sort operation on a table.
// A sort can only be done on a scalar column.
// </synopsis>
class TableInvSort : public TableError {
public:
// The default constructor generates a generic "invalid sort" message.
TableInvSort (Category c=INVALID_ARGUMENT);
// This constructor appends the given message to the "invalid sort"
// message.
TableInvSort (const String& message,Category c=INVALID_ARGUMENT);
~TableInvSort () noexcept;
};
// <summary>
// Table error; invalid logical operation
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Invalid logical table operation.
// When combining tables using a union, difference, etc., the
// tables involved have to stem from the same root. I.e. they
// should all refer to the same underlying table.
// </synopsis>
class TableInvLogic : public TableError {
public:
// The default constructor generates the message.
TableInvLogic (Category c=INVALID_ARGUMENT);
~TableInvLogic () noexcept;
};
// <summary>
// Table error; invalid select expression
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Invalid table select expression.
// A column is not a scalar or belongs to another table than
// the table on which the selection will be done.
// </synopsis>
class TableInvExpr : public TableError {
public:
TableInvExpr (const String& message,Category c=INVALID_ARGUMENT);
// This constructor generates a message containing the name of
// the offending column. It appends the given message.
TableInvExpr (const String& columnName, const String& message,Category c=INVALID_ARGUMENT);
~TableInvExpr () noexcept;
};
// <summary>
// Table error; non-conformant table vectors
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// Table vectors are not conformant (have different lengths)
// </synopsis>
class TableVectorNonConform : public TableError {
public:
// The default constructor generates the message.
TableVectorNonConform (Category c=CONFORMANCE);
~TableVectorNonConform () noexcept;
};
// <summary>
// Table error; invalid table command
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// The parser in TableGram/TableParse found an error in
// the given table command.
// </synopsis>
class TableParseError : public TableError {
public:
// This constructor generates a message containing the table command.
TableParseError (const String& commandString,
int pos=-1, const String& token=String(),
Category c=INVALID_ARGUMENT);
~TableParseError () noexcept;
// Get error position or token.
int pos() const
{return itsPos; }
const String& token() const
{ return itsToken; }
private:
int itsPos;
String itsToken;
};
// <summary>
// Table grammar error; invalid table command
// </summary>
// <use visibility=export>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <synopsis>
// The parser in TableGram/TableParse found an error in
// the given table command.
// </synopsis>
class TableGramError : public TableError {
public:
// This constructor generates a message containing the table command.
TableGramError (int pos, const String& token,
Category c=INVALID_ARGUMENT);
~TableGramError () noexcept;
// Get error position or token.
int pos() const
{return itsPos; }
const String& token() const
{ return itsToken; }
private:
int itsPos;
String itsToken;
};
} //# NAMESPACE CASACORE - END
#endif
casacore::AipsError::AipsError
AipsError(const Char *str, Category c=GENERAL)
Creates an AipsError and initializes the error message from the parameter.
casacore::AipsError::message
String message
Definition Error.h:201
casacore::AipsError::Category
Category
Definition Error.h:136
casacore::AipsError::INITIALIZATION
@ INITIALIZATION
Definition Error.h:137
casacore::AipsError::INVALID_ARGUMENT
@ INVALID_ARGUMENT
Definition Error.h:137
casacore::AipsError::GENERAL
@ GENERAL
Definition Error.h:138
casacore::AipsError::CONFORMANCE
@ CONFORMANCE
Definition Error.h:137
casacore::IPosition
Definition IPosition.h:117
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::TableArrayConformanceError::TableArrayConformanceError
TableArrayConformanceError(const String &message, const IPosition &shape, const IPosition &expectedShape, Category c=CONFORMANCE)
This constructor appends ": Table array conformance error" to the given message with the given and ex...
casacore::TableArrayConformanceError::TableArrayConformanceError
TableArrayConformanceError(const String &message, Category c=CONFORMANCE)
This constructor appends ": Table array conformance error" to the given message.
casacore::TableArrayConformanceError::~TableArrayConformanceError
~TableArrayConformanceError() noexcept
casacore::TableConformanceError::~TableConformanceError
~TableConformanceError() noexcept
casacore::TableConformanceError::TableConformanceError
TableConformanceError(const String &message, Category c=CONFORMANCE)
This constructor appends ": Table conformance error (\#rows mismatch)" to the given message.
casacore::TableDescNoName::~TableDescNoName
~TableDescNoName() noexcept
casacore::TableDescNoName::TableDescNoName
TableDescNoName(Category c=INITIALIZATION)
The default constructor generates the message.
casacore::TableDuplFile::TableDuplFile
TableDuplFile(const String &name, Category c=INVALID_ARGUMENT)
This constructor generates a message telling that the a table or description with the given name alre...
casacore::TableDuplFile::~TableDuplFile
~TableDuplFile() noexcept
casacore::TableDuplFile::TableDuplFile
TableDuplFile(const String &name, const String &message, Category c=INVALID_ARGUMENT)
This constructor generates a message telling that the a table or description with the given name alre...
casacore::TableError::TableError
TableError(const String &message, Category c=GENERAL)
Construct with given message.
casacore::TableError::TableError
TableError(Category c=GENERAL)
The default constructor generates the message "Table error".
casacore::TableError::~TableError
~TableError() noexcept
casacore::TableGramError::pos
int pos() const
Get error position or token.
Definition TableError.h:536
casacore::TableGramError::itsToken
String itsToken
Definition TableError.h:542
casacore::TableGramError::TableGramError
TableGramError(int pos, const String &token, Category c=INVALID_ARGUMENT)
This constructor generates a message containing the table command.
casacore::TableGramError::~TableGramError
~TableGramError() noexcept
casacore::TableGramError::token
const String & token() const
Definition TableError.h:538
casacore::TableGramError::itsPos
int itsPos
Definition TableError.h:541
casacore::TableInternalError::~TableInternalError
~TableInternalError() noexcept
casacore::TableInternalError::TableInternalError
TableInternalError(const String &message, Category c=GENERAL)
Add given message to string "Internal Table error: ".
casacore::TableInvColumnDesc::TableInvColumnDesc
TableInvColumnDesc(const String &columnName, const String &message, Category c=INVALID_ARGUMENT)
This constructor generates a message that the column with the given name has an invalid description.
casacore::TableInvColumnDesc::~TableInvColumnDesc
~TableInvColumnDesc() noexcept
casacore::TableInvDT::~TableInvDT
~TableInvDT() noexcept
casacore::TableInvDT::TableInvDT
TableInvDT(Category c=CONFORMANCE)
The default constructor generates a generic "invalid data type" message.
casacore::TableInvDT::TableInvDT
TableInvDT(const String &columName, Category c=CONFORMANCE)
Put the name of the offending column in the "invalid data type" message.
casacore::TableInvExpr::~TableInvExpr
~TableInvExpr() noexcept
casacore::TableInvExpr::TableInvExpr
TableInvExpr(const String &message, Category c=INVALID_ARGUMENT)
casacore::TableInvExpr::TableInvExpr
TableInvExpr(const String &columnName, const String &message, Category c=INVALID_ARGUMENT)
This constructor generates a message containing the name of the offending column.
casacore::TableInvHyperDesc::~TableInvHyperDesc
~TableInvHyperDesc() noexcept
casacore::TableInvHyperDesc::TableInvHyperDesc
TableInvHyperDesc(const String &hypercolumnName, const String &message, Category c=INVALID_ARGUMENT)
This constructor generates a message that the hypercolumn with the given name has an invalid descript...
casacore::TableInvLogic::~TableInvLogic
~TableInvLogic() noexcept
casacore::TableInvLogic::TableInvLogic
TableInvLogic(Category c=INVALID_ARGUMENT)
The default constructor generates the message.
casacore::TableInvOper::TableInvOper
TableInvOper(Category c=INVALID_ARGUMENT)
The default constructor generates a generic "invalid operation" message.
casacore::TableInvOper::~TableInvOper
~TableInvOper() noexcept
casacore::TableInvOper::TableInvOper
TableInvOper(const String &message, Category c=INVALID_ARGUMENT)
Add given message to string "Invalid Table operation: ".
casacore::TableInvOpt::~TableInvOpt
~TableInvOpt() noexcept
casacore::TableInvOpt::TableInvOpt
TableInvOpt(const String &className, const String &message, Category c=INVALID_ARGUMENT)
This constructor generates a message that an invalid option has been given.
casacore::TableInvSort::TableInvSort
TableInvSort(Category c=INVALID_ARGUMENT)
The default constructor generates a generic "invalid sort" message.
casacore::TableInvSort::TableInvSort
TableInvSort(const String &message, Category c=INVALID_ARGUMENT)
This constructor appends the given message to the "invalid sort" message.
casacore::TableInvSort::~TableInvSort
~TableInvSort() noexcept
casacore::TableInvType::~TableInvType
~TableInvType() noexcept
casacore::TableInvType::TableInvType
TableInvType(const String &tablename, const String &typeIn, const String &typeFile, Category c=CONFORMANCE)
This constructor generates a message that the in table type mismatches the table type in the file.
casacore::TableNoDatFile::TableNoDatFile
TableNoDatFile(const String &filename, Category c=INVALID_ARGUMENT)
This constructor generates a message telling that the a table or datription file does not exist.
casacore::TableNoDatFile::~TableNoDatFile
~TableNoDatFile() noexcept
casacore::TableNoDir::~TableNoDir
~TableNoDir() noexcept
casacore::TableNoDir::TableNoDir
TableNoDir(const String &name, Category c=INVALID_ARGUMENT)
This constructor generates a message telling that the table directory with the given name does not ex...
casacore::TableNoFile::TableNoFile
TableNoFile(const String &name, Category c=INVALID_ARGUMENT)
This constructor generates a message telling that the a table or description with the given name does...
casacore::TableNoFile::~TableNoFile
~TableNoFile() noexcept
casacore::TableParseError::itsToken
String itsToken
Definition TableError.h:513
casacore::TableParseError::token
const String & token() const
Definition TableError.h:509
casacore::TableParseError::~TableParseError
~TableParseError() noexcept
casacore::TableParseError::itsPos
int itsPos
Definition TableError.h:512
casacore::TableParseError::pos
int pos() const
Get error position or token.
Definition TableError.h:507
casacore::TableParseError::TableParseError
TableParseError(const String &commandString, int pos=-1, const String &token=String(), Category c=INVALID_ARGUMENT)
This constructor generates a message containing the table command.
casacore::TableUnknownDesc::~TableUnknownDesc
~TableUnknownDesc() noexcept
casacore::TableUnknownDesc::TableUnknownDesc
TableUnknownDesc(const String &name, Category c=INITIALIZATION)
This constructor generates a message that the class with the given name is unknown (not registered).
casacore::TableVectorNonConform::TableVectorNonConform
TableVectorNonConform(Category c=CONFORMANCE)
The default constructor generates the message.
casacore::TableVectorNonConform::~TableVectorNonConform
~TableVectorNonConform() noexcept
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::shape
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
casacore::name
String name() const
Return the name of the field.
Definition RecordField.h:163