67 protectIn = gateHalf(
"protect$i", cGate::INPUT);
68 protectOut = gateHalf(
"protect$o", cGate::OUTPUT);
69 unprotectIn = gateHalf(
"unprotect$i", cGate::INPUT);
78 if (msg->isSelfMessage())
80 if (!opp_strcmp(msg->getFullName(),
"portTransmitEnd"))
85 else if (!opp_strcmp(msg->getFullName(),
"readyToServe"))
89 else if (!opp_strcmp(msg->getFullName(),
"readyForRead"))
109 if(sduData ==
nullptr){
111 EV <<
"this type of message isn't supported!" << endl;
114 PDU* pdu =
static_cast<PDU*
>(sduData->decapsulate());
117 std::string queueID =
122 if (inQueue !=
nullptr)
130 <<
": no input queue of such queue-id (" << queueID
131 <<
") available!" << endl;
135 else if (msg->getArrivalGate() ==
protectIn)
137 PDU* pdu =
dynamic_cast<PDU*
>(msg);
140 EV <<
"this type of message isn't supported!" << endl;
146 sduData->encapsulate(pdu);
152 simtime_t transmitEnd =
outputChannel->getTransmissionFinishTime();
153 if (transmitEnd > simTime())
155 scheduleAt(transmitEnd,
new cMessage(
"portTransmitEnd"));
223 return queueVect.front();
233 for(
auto const q : queueVect)
235 if (q->getLength() > longest)
248 std::ostringstream fullId;
251 for(
auto const q : queueVect)
253 if (!opp_strcmp(q->getFullName(), fullId.str().c_str()))
305 scheduleAt(simTime(),
new cMessage(
"readyToServe"));
310 Enter_Method_Silent(
"scheduleNextRead()");
312 scheduleAt(simTime() +
postReadDelay,
new cMessage(
"readyForRead"));
343 if (getEnvir()->isGUI())
345 getDisplayString().setTagArg(
"i2", 0, (
isOutputReady() ?
"status/green" :
"status/noentry"));
349 std::ostringstream ostr;
350 ostr <<
"dstApp: " << endl <<
dstAppAddr << endl
354 ostr << endl <<
"input blocked";
358 ostr << endl <<
"output blocked" << endl;
361 cDisplayString& dStr = getParentModule()->getDisplayString();
363 dStr.setTagArg(
"t", 0, ostr.str().c_str());
364 dStr.setTagArg(
"t", 1,
"r");
379 if (getEnvir()->isGUI())
385 dstAppAddr = dstAppFull.substr(0, dstAppFull.find(
"_"));
399 EV << getFullPath() <<
": blocking the port output." << endl;
410 EV << getFullPath() <<
": unblocking the port output." << endl;
418 EV << getFullPath() <<
": blocking the port input." << endl;
425 EV << getFullPath() <<
": unblocking the port input." << endl;
Class representing flow object with attributes from specs.
void unregisterOutputQueue(RMTQueue *queue)
const char * MOD_RESALLOC
void redrawGUI(bool redrawParent=false)
const char * SIG_STAT_RMTPORT_DOWN
simsignal_t sigRMTPortReadyForRead
cGate * getOutputGate() const
simsignal_t sigStatRMTPortDown
QueueIDGenBase * queueIdGen
std::string getQoSId() const
Getter of selected QoS-cube identifier.
unsigned long waitingOnInput
RMTQueue * getFirstQueue(RMTQueueType type) const
void setInputRate(long pdusPerSecond)
void unregisterInputQueue(RMTQueue *queue)
const char * SIG_RMT_PortReadyToServe
RMTQueue * getLongestQueue(RMTQueueType type) const
RMTQueues & getInputQueues()
std::set< cGate * > northInputGates
virtual ConnectionId & getConnId()
unsigned long waitingOnOutput
const APN & getApn() const
Getter of APN.
const char * SIG_STAT_RMTPORT_UP
const char * SIG_RMT_PortReadyForRead
virtual std::string generateInputQueueID(PDU *pdu)
RMTQueues & getOutputQueues()
simsignal_t sigStatRMTPortUp
const char * MOD_POL_RA_IDGENERATOR
const char * GATE_SOUTHIO
unsigned long getWaiting(RMTQueueType direction)
cGate * getSouthInputGate() const
void substractWaiting(RMTQueueType direction)
void addWaiting(RMTQueueType direction)
const ConnectionId & getConId() const
Gets read-only Flow's ConnectionId.
void registerInputQueue(RMTQueue *queue)
cGate * getInputGate() const
simsignal_t sigRMTPortReadyToWrite
RMTQueue * getQueueById(RMTQueueType type, const char *queueId) const
cGate * getSouthOutputGate() const
const std::string & getName() const
Gets APN string name representation.
void registerOutputQueue(RMTQueue *queue)
const Flow * getFlow() const
std::vector< RMTQueue * > RMTQueues
const APNamingInfo & getDstApni() const
Gets read-only destination APNamingInfo.
virtual void handleMessage(cMessage *msg)
virtual void initialize()