GENIEGenerator
Loading...
Searching...
No Matches
genie::exceptions::InteractionException Class Reference

Exception used inside Interaction classes. More...

#include <InteractionException.h>

Inheritance diagram for genie::exceptions::InteractionException:
[legend]
Collaboration diagram for genie::exceptions::InteractionException:
[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 \at fnal.gov> Tufts University
Created:\n July 15, 2016
License:\n Copyright (c) 2003-2025, 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

◆ InteractionException() [1/2]

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

Definition at line 21 of file InteractionException.cxx.

References fReason.

◆ InteractionException() [2/2]

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

Definition at line 25 of file InteractionException.cxx.

26 : fReason(reason)
27 {}

References fReason.

◆ ~InteractionException()

genie::exceptions::InteractionException::~InteractionException ( )
throw ( )
inline

Definition at line 34 of file InteractionException.h.

34{};

Member Function Documentation

◆ Print()

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

Definition at line 29 of file InteractionException.cxx.

30 {
31 stream << "**EXCEPTION Reason: " << this->ShowReason() << std::endl;
32 }

References ShowReason().

Referenced by operator<<.

◆ ShowReason()

const std::string & genie::exceptions::InteractionException::ShowReason ( ) const
inline

Definition at line 37 of file InteractionException.h.

37{ return fReason; }

References fReason.

Referenced by Print().

◆ what()

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

Definition at line 40 of file InteractionException.h.

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

References fReason.

◆ operator<<

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}

References Print().

Member Data Documentation

◆ fReason

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

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