GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | Friends | List of all members
genie::exceptions::InteractionException Class Reference

Exception used inside Interaction classes. More...

#include <InteractionException.h>

Inheritance diagram for genie::exceptions::InteractionException:
Inheritance graph
[legend]
Collaboration diagram for genie::exceptions::InteractionException:
Collaboration graph
[legend]

Public Member Functions

 InteractionException ()
 
 InteractionException (const std::string &reason)
 
 ~InteractionException () throw ()
 
void Print (std::ostream &stream) const
 
const std::string & ShowReason () const
 
const char * what () const throw ()
 

Private Attributes

std::string fReason
 

Friends

std::ostream & operator<< (std::ostream &stream, const InteractionException &exception)
 

Detailed Description

Exception used inside Interaction classes.

Author
Jeremy Wolcott <jwolcott fnal.gov> Tufts University
Created:
July 15, 2016
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 29 of file InteractionException.h.

Constructor & Destructor Documentation

genie::exceptions::InteractionException::InteractionException ( )

Definition at line 21 of file InteractionException.cxx.

genie::exceptions::InteractionException::InteractionException ( const std::string &  reason)

Definition at line 25 of file InteractionException.cxx.

26  : fReason(reason)
27  {}
genie::exceptions::InteractionException::~InteractionException ( )
throw (
)
inline

Definition at line 34 of file InteractionException.h.

34 {};

Member Function Documentation

void genie::exceptions::InteractionException::Print ( std::ostream &  stream) const

Definition at line 29 of file InteractionException.cxx.

References ShowReason().

Referenced by operator<<().

30  {
31  stream << "**EXCEPTION Reason: " << this->ShowReason() << std::endl;
32  }
const std::string & ShowReason() const
const std::string& genie::exceptions::InteractionException::ShowReason ( void  ) const
inline

Definition at line 37 of file InteractionException.h.

References fReason.

Referenced by Print().

const char* genie::exceptions::InteractionException::what ( ) const
throw (
)
inline

Definition at line 40 of file InteractionException.h.

References fReason.

40 { return this->fReason.c_str(); };

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const InteractionException exception 
)
friend

Definition at line 37 of file InteractionException.cxx.

38 {
39  exc.Print(stream);
40  return stream;
41 }

Member Data Documentation

std::string genie::exceptions::InteractionException::fReason
private

Definition at line 45 of file InteractionException.h.

Referenced by ShowReason(), and what().


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