Classes | Namespaces | Macros
Xpetra_Exceptions.hpp File Reference
#include <exception>
#include <Teuchos_Exceptions.hpp>
#include <Teuchos_Assert.hpp>
#include "Xpetra_ConfigDefs.hpp"

Go to the source code of this file.

Classes

class  Xpetra::Exceptions::BadCast
 Exception indicating invalid cast attempted. More...
 
class  Xpetra::Exceptions::NotImplemented
 Exception throws when you call an unimplemented method of Xpetra. More...
 
class  Xpetra::Exceptions::RuntimeError
 Exception throws to report errors in the internal logical of the program. More...
 
class  Xpetra::Exceptions::Incompatible
 Exception throws to report incompatible objects (like maps). More...
 

Namespaces

 Xpetra
 Xpetra namespace
 
 Xpetra::Exceptions
 

Macros

#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
 
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
 
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
 
#define XPETRA_FACTORY_END   TEUCHOS_TEST_FOR_EXCEPTION(1, ::Xpetra::Exceptions::BadCast, "Unknown map->lib() type. Did you compile with Epetra and Tpetra support?");
 

Macro Definition Documentation

#define XPETRA_DYNAMIC_CAST (   type,
  obj,
  newObj,
  exceptionMsg 
)
Value:
type * newObj ## _pt = dynamic_cast<type *>(&obj); \
TEUCHOS_TEST_FOR_EXCEPTION(newObj ## _pt == NULL, Xpetra::Exceptions::BadCast, "Cannot cast '" #obj "' to a " #type ". " #exceptionMsg); \
type & newObj = *newObj ## _pt;
Exception indicating invalid cast attempted.

Definition at line 57 of file Xpetra_Exceptions.hpp.

#define XPETRA_RCP_DYNAMIC_CAST (   type,
  obj,
  newObj,
  exceptionMsg 
)
Value:
const RCP<type > & newObj = Teuchos::rcp_dynamic_cast<type >(obj); \
TEUCHOS_TEST_FOR_EXCEPTION(newObj == Teuchos::null, Xpetra::Exceptions::BadCast, "Cannot cast '" #obj "' to a " #type ". " #exceptionMsg);
Exception indicating invalid cast attempted.

Definition at line 64 of file Xpetra_Exceptions.hpp.

#define XPETRA_FACTORY_ERROR_IF_EPETRA (   lib)
Value:
if ((lib) == ::Xpetra::UseEpetra) \
TEUCHOS_TEST_FOR_EXCEPTION(1, ::Xpetra::Exceptions::BadCast, "Epetra can only be used with Scalar=double and Ordinal=int");
Exception indicating invalid cast attempted.

Definition at line 69 of file Xpetra_Exceptions.hpp.

#define XPETRA_FACTORY_END   TEUCHOS_TEST_FOR_EXCEPTION(1, ::Xpetra::Exceptions::BadCast, "Unknown map->lib() type. Did you compile with Epetra and Tpetra support?");

Definition at line 76 of file Xpetra_Exceptions.hpp.