EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PyCallable Class Reference

#include "PyCallable.h"

Inheritance diagram for PyCallable:
Collaboration diagram for PyCallable:

Classes

class  CallDispatcher
 

Public Member Functions

 PyCallable ()
 
virtual ~PyCallable ()
 
virtual PyResult Call (const std::string &method, PyCallArgs &args)
 

Protected Member Functions

void _SetCallDispatcher (CallDispatcher *d)
 

Private Attributes

CallDispatcherm_serviceDispatch
 

Detailed Description

Definition at line 69 of file PyCallable.h.

Constructor & Destructor Documentation

PyCallable::PyCallable ( )

Definition at line 30 of file PyCallable.cpp.

31 : m_serviceDispatch(nullptr)
32 {
33 }
CallDispatcher * m_serviceDispatch
Definition: PyCallable.h:90
PyCallable::~PyCallable ( )
virtual

Definition at line 35 of file PyCallable.cpp.

36 {
37 }

Member Function Documentation

PyResult PyCallable::Call ( const std::string &  method,
PyCallArgs args 
)
virtual

Reimplemented in PyService, and PyBoundObject.

Definition at line 39 of file PyCallable.cpp.

References _log, PyCallable::CallDispatcher::Dispatch(), PyRep::Dump(), is_log_enabled, m_serviceDispatch, and PyException::ssException.

Referenced by PyBoundObject::Call(), PyService::Call(), and Client::Handle_CallReq().

39  {
40  //call the dispatcher, capturing the result.
41  try {
42  PyResult res(m_serviceDispatch->Dispatch(method, args));
43 
44  if (is_log_enabled(SERVICE__CALL_TRACE)) {
45  _log(SERVICE__CALL_TRACE, "Call %s returned:", method.c_str());
46  res.ssResult->Dump(SERVICE__CALL_TRACE, " ");
47  }
48  return res;
49  } catch(PyException &e) {
50  if (is_log_enabled(SERVICE__CALL_ERROR)) {
51  _log(SERVICE__CALL_ERROR, "Call %s threw exception:", method.c_str());
52  e.ssException->Dump(SERVICE__CALL_ERROR, " ");
53  }
54  throw;
55  }
56 }
CallDispatcher * m_serviceDispatch
Definition: PyCallable.h:90
#define _log(type, fmt,...)
Definition: logsys.h:124
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
#define is_log_enabled(type)
Definition: logsys.h:78
Base class for exceptions that can be converted to python objects.
Definition: PyExceptions.h:39
virtual PyResult Dispatch(const std::string &method_name, PyCallArgs &call)=0
PyRep * ssException
Definition: PyExceptions.h:48

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

CallDispatcher* PyCallable::m_serviceDispatch
private

Definition at line 90 of file PyCallable.h.

Referenced by _SetCallDispatcher(), and Call().


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