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

#include "PyCallable.h"

Collaboration diagram for PyCallArgs:

Public Member Functions

 PyCallArgs (Client *c, PyTuple *tup, PyDict *dict)
 
 ~PyCallArgs ()
 
void Dump (LogType type) const
 

Public Attributes

Client *const client
 
PyTupletuple
 
std::map< std::string, PyRep * > byname
 

Detailed Description

Definition at line 41 of file PyCallable.h.

Constructor & Destructor Documentation

PyCallArgs::PyCallArgs ( Client c,
PyTuple tup,
PyDict dict 
)

Definition at line 59 of file PyCallable.cpp.

References _log, PyDict::begin(), byname, PyDict::end(), and PyIncRef.

60 : client(c),
61  tuple(tup)
62 {
63  // PyIncRef( tup );
64  for (PyDict::const_iterator cur = dict->begin(); cur != dict->end(); cur++) {
65  if (!cur->first->IsString()) {
66  _log(SERVICE__ERROR, "Non-string key in call named arguments. Skipping.");
67  cur->first->Dump(SERVICE__ERROR, " ");
68  continue;
69  }
70  PyIncRef( cur->second );
71  byname[ cur->first->AsString()->content() ] = cur->second;
72  }
73 }
#define _log(type, fmt,...)
Definition: logsys.h:124
std::map< std::string, PyRep * > byname
Definition: PyCallable.h:51
Client *const client
Definition: PyCallable.h:49
#define PyIncRef(op)
Definition: PyRep.h:56
const_iterator begin() const
Definition: PyRep.h:766
storage_type::const_iterator const_iterator
Definition: PyRep.h:750
const_iterator end() const
Definition: PyRep.h:767
PyTuple * tuple
Definition: PyCallable.h:50

Here is the call graph for this function:

PyCallArgs::~PyCallArgs ( )

Definition at line 75 of file PyCallable.cpp.

References byname, PySafeDecRef, and tuple.

75  {
77  for (auto cur : byname)
78  PySafeDecRef( cur.second );
79 }
std::map< std::string, PyRep * > byname
Definition: PyCallable.h:51
#define PySafeDecRef(op)
Definition: PyRep.h:61
PyTuple * tuple
Definition: PyCallable.h:50

Member Function Documentation

void PyCallArgs::Dump ( LogType  type) const

Definition at line 81 of file PyCallable.cpp.

References _log, byname, PyRep::Dump(), is_log_enabled, and tuple.

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

81  {
82  if (!is_log_enabled(type))
83  return;
84 
85  _log(type, " Call Arguments:");
86  tuple->Dump(type, " ");
87  if (!byname.empty()) {
88  _log(type, " Named Arguments:");
89  for (auto cur : byname) {
90  _log(type, " %s", cur.first.c_str());
91  cur.second->Dump(type, " ");
92  }
93  }
94 }
#define _log(type, fmt,...)
Definition: logsys.h:124
std::map< std::string, PyRep * > byname
Definition: PyCallable.h:51
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
PyTuple * tuple
Definition: PyCallable.h:50

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::map<std::string, PyRep*> PyCallArgs::byname

Definition at line 51 of file PyCallable.h.

Referenced by Dump(), PyCallArgs(), and ~PyCallArgs().

Client* const PyCallArgs::client

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