Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Pyston::ExceptionRaiser< T > Class Template Reference

#include <ExceptionRaiser.h>

Collaboration diagram for Pyston::ExceptionRaiser< T >:
Collaboration graph
[legend]

Public Member Functions

 ExceptionRaiser (const std::string &msg, bool recoverable)
 
void operator() (const std::shared_ptr< Node< T > > &)
 

Private Attributes

std::string m_msg
 
bool m_recoverable
 

Detailed Description

template<typename T>
class Pyston::ExceptionRaiser< T >

Convenience functor that just raises a Python error whenever called. It can be used to attach methods that can only fail to Python objects.

Template Parameters
TNode type

Definition at line 37 of file ExceptionRaiser.h.

Constructor & Destructor Documentation

◆ ExceptionRaiser()

template<typename T >
Pyston::ExceptionRaiser< T >::ExceptionRaiser ( const std::string msg,
bool  recoverable 
)
inline

Constructor

Parameters
msgMessage for the exception
recoverableIf true, the exception is considered to be recoverable (fallback python evaluation)

Definition at line 46 of file ExceptionRaiser.h.

Member Function Documentation

◆ operator()()

template<typename T >
void Pyston::ExceptionRaiser< T >::operator() ( const std::shared_ptr< Node< T > > &  )
inline

Callable

Exceptions
boost::python::error_already_setAlways. It will set previously a RuntimeError with the given message.

Definition at line 53 of file ExceptionRaiser.h.

References std::string::c_str(), Pyston::ExceptionRaiser< T >::m_msg, and Pyston::ExceptionRaiser< T >::m_recoverable.

Here is the call graph for this function:

Member Data Documentation

◆ m_msg

template<typename T >
std::string Pyston::ExceptionRaiser< T >::m_msg
private

Definition at line 61 of file ExceptionRaiser.h.

Referenced by Pyston::ExceptionRaiser< T >::operator()().

◆ m_recoverable

template<typename T >
bool Pyston::ExceptionRaiser< T >::m_recoverable
private

Definition at line 62 of file ExceptionRaiser.h.

Referenced by Pyston::ExceptionRaiser< T >::operator()().


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