void Client::handleCall() { auto p = reinterpret_cast<PacketCall*>(&receive_); std::cout << "Received call for " << (p->global ? "all" : "me") << " @ " << std::asctime(std::localtime(&p->time)); // Call all onCalls for (auto onCall : onCalls_) { onCall(p->global); } }
void HttpMethod::call() { try { onCall(); } catch (base::AppException& e) { LOG(error, EXCEPTION_DIAG_INFO(e)); replyError(400, e.msg()); } catch (exception& e) { LOG(error, EXCEPTION_DIAG_INFO(e)); replyError(500, e.what()); } }
void ScriptFunction::operator()(const ScriptFunctionParameter* parameter, ScriptFunctionResult* result) const { onCall(parameter, result); ScriptEnvironment::initScriptNodes(); }