int Logic::process(void) { if (!m_operationPermitted) return CYNARA_API_OPERATION_NOT_ALLOWED; bool completed; while (true) { int ret = completeConnection(completed); if (!completed) return ret; if (processOut() && processIn()) return CYNARA_API_SUCCESS; onDisconnected(); if (!connect()) return CYNARA_API_SERVICE_NOT_AVAILABLE; } }
/** * @brief Implementation of internal transition DEVS * function */ void internalTransition(vd::Time t) override { processOut(t, INTERNAL); updateGuards(t, INTERNAL); switch (devs_state) { case INIT: devs_state = COMPUTE; break; case COMPUTE: devs_state = OUTPUT; break; case OUTPUT: devs_state = COMPUTE; break; default: throw vu::InternalError("default 2"); } processIn(t, INTERNAL); }
void confluentTransitions(vd::Time t, const vd::ExternalEventList& ext) override { processOut(t, CONFLUENT); handleExtEvt(t, ext); updateGuards(t, CONFLUENT); switch (devs_state) { case INIT: devs_state = COMPUTE; break; case COMPUTE: devs_state=OUTPUT; break; case OUTPUT: devs_state = COMPUTE; break; default: throw vu::InternalError("default confluent"); } processIn(t, CONFLUENT); }
void externalTransition(const vd::ExternalEventList& event, vd::Time t) override { processOut(t, EXTERNAL); handleExtEvt(t, event); updateGuards(t, EXTERNAL); switch (devs_state) { case INIT: throw vu::InternalError("Error 3"); break; case COMPUTE: devs_state = COMPUTE; break; case OUTPUT: throw vu::InternalError("Error 4"); break; default: throw vu::InternalError("default"); } processIn(t, EXTERNAL); }