INET Framework for OMNeT++/OMNEST
inet::EchoProtocolPrinter Class Reference

#include <EchoProtocolPrinter.h>

Inheritance diagram for inet::EchoProtocolPrinter:
inet::ProtocolPrinter

Public Member Functions

virtual void print (const Ptr< const Chunk > &chunk, const Protocol *protocol, const cMessagePrinter::Options *options, Context &context) const override
 Prints the given chunk of protocol according to options into context. More...
 

Member Function Documentation

◆ print()

void inet::EchoProtocolPrinter::print ( const Ptr< const Chunk > &  chunk,
const Protocol protocol,
const cMessagePrinter::Options *  options,
Context context 
) const
overridevirtual

Prints the given chunk of protocol according to options into context.

Implements inet::ProtocolPrinter.

19 {
20  if (auto header = dynamicPtrCast<const EchoPacket>(chunk)) {
21  context.infoColumn << "Echo";
22  switch (header->getType()) {
24  context.infoColumn << " request";
25  break;
27  context.infoColumn << " reply";
28  break;
29  default:
30  context.infoColumn << " type=" << header->getType();
31  break;
32  }
33  context.infoColumn << " id:" << header->getIdentifier() << " seq:" << header->getSeqNumber();
34  }
35  else
36  context.infoColumn << "(Echo) " << chunk;
37 }

The documentation for this class was generated from the following files:
inet::ECHO_PROTOCOL_REQUEST
@ ECHO_PROTOCOL_REQUEST
Definition: EchoPacket_m.h:58
inet::ECHO_PROTOCOL_REPLY
@ ECHO_PROTOCOL_REPLY
Definition: EchoPacket_m.h:59