casacore
Loading...
Searching...
No Matches
casacore::AllocError Class Reference

Allocation errors. More...

#include <Error.h>

Public Member Functions

 AllocError (const Char *str, uInt sze)
 This constructor takes the error message and the failed allocation size.
 AllocError (const String &str, uInt sze)
size_t size () const
 This function returns the failed allocation size.
 ~AllocError () noexcept
 Destructor which does nothing.
Public Member Functions inherited from casacore::AipsError
virtual const char * what () const noexcept
 Simply returns the stored error message.
const StringgetMesg () const
String getStackTrace () const
AipsError::Category getCategory () const
void setMessage (const String &msg) const
 Append a message.
 AipsError (const Char *str, Category c=GENERAL)
 Creates an AipsError and initializes the error message from the parameter.
 AipsError (const String &str, Category c=GENERAL)
 AipsError (const String &msg, const String &filename, uInt lineNumber, Category c=GENERAL)
 AipsError (Category c=GENERAL)
 ~AipsError () noexcept
 Destructor which does nothing.

Protected Attributes

size_t Size
Protected Attributes inherited from casacore::AipsError
String message
Category category
String stackTrace

Additional Inherited Members

Public Types inherited from casacore::AipsError
enum  Category {
  BOUNDARY ,
  INITIALIZATION ,
  INVALID_ARGUMENT ,
  CONFORMANCE ,
  ENVIRONMENT ,
  SYSTEM ,
  PERMISSION ,
  GENERAL
}
Static Public Member Functions inherited from casacore::AipsError
static void getLastInfo (String &message, String &stackTrace)
 Get or clear the stacktrace info.
static String getLastMessage ()
static String getLastStackTrace ()
static void clearLastInfo ()
static AipsError repackageAipsError (AipsError &error, const String &message, const char *file, Int line, const char *func)
 Repackage an exception.
static void throwIf (Bool condition, const String &message, const char *file, Int line, const char *func="")
 Throw if the condition is true.
static void throwIfError (Int errorCode, const String &prefix, const char *file, Int line, const char *func="")
 Throw if the system error code is not 0.
Protected Member Functions inherited from casacore::AipsError
void addStackTrace ()
 Add the stack trace to the message (if USE_STACKTRACE is set).

Detailed Description

Allocation errors.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

This class is used for allocation errors. It adds an extra data item, the failed allocation size. Otherwise much the same as AipsError.

Example

throw(AllocError("ANY STRING",1024));
AllocError(const Char *str, uInt sze)
This constructor takes the error message and the failed allocation size.
Definition Error.h:239

Definition at line 230 of file Error.h.

Constructor & Destructor Documentation

◆ AllocError() [1/2]

casacore::AllocError::AllocError ( const Char * str,
uInt sze )
inline

This constructor takes the error message and the failed allocation size.

Definition at line 239 of file Error.h.

References casacore::AipsError::AipsError(), Size, and casacore::AipsError::SYSTEM.

◆ AllocError() [2/2]

casacore::AllocError::AllocError ( const String & str,
uInt sze )
inline

Definition at line 240 of file Error.h.

References casacore::AipsError::AipsError(), Size, and casacore::AipsError::SYSTEM.

◆ ~AllocError()

casacore::AllocError::~AllocError ( )
noexcept

Destructor which does nothing.

Member Function Documentation

◆ size()

size_t casacore::AllocError::size ( ) const
inline

This function returns the failed allocation size.

Definition at line 246 of file Error.h.

References Size.

Member Data Documentation

◆ Size

size_t casacore::AllocError::Size
protected

Definition at line 232 of file Error.h.

Referenced by AllocError(), AllocError(), and size().


The documentation for this class was generated from the following file: