INET Framework for OMNeT++/OMNEST
inet::InetPacketBytesPrinter Class Reference
Inheritance diagram for inet::InetPacketBytesPrinter:

Public Member Functions

 InetPacketBytesPrinter ()
 
virtual ~InetPacketBytesPrinter ()
 
virtual int getScoreFor (cMessage *msg) const override
 
virtual void printMessage (std::ostream &os, cMessage *msg) const override
 

Protected Attributes

bool showEncapsulatedPackets
 

Constructor & Destructor Documentation

inet::InetPacketBytesPrinter::InetPacketBytesPrinter ( )
inline
28 { showEncapsulatedPackets = true; }
bool showEncapsulatedPackets
Definition: InetPacketBytesPrinter.cc:25
virtual inet::InetPacketBytesPrinter::~InetPacketBytesPrinter ( )
inlinevirtual
29 {}

Member Function Documentation

int inet::InetPacketBytesPrinter::getScoreFor ( cMessage *  msg) const
overridevirtual
40 {
41  return msg->isPacket() ? 18 : 0;
42 }
void inet::InetPacketBytesPrinter::printMessage ( std::ostream &  os,
cMessage *  msg 
) const
overridevirtual
45 {
46  std::string outs;
47 
48  //reset mutable variables
50 
51  for (cPacket *pk = dynamic_cast<cPacket *>(msg); showEncapsulatedPackets && pk; pk = pk->getEncapsulatedPacket()) {
52  std::ostringstream out;
53  out << pk->getClassName() << ":" << pk->getByteLength() << " bytes";
54  if (outs.length())
55  out << INFO_SEPAR << outs;
56  outs = out.str();
57  }
58  os << outs;
59 }
bool showEncapsulatedPackets
Definition: InetPacketBytesPrinter.cc:25

Member Data Documentation

bool inet::InetPacketBytesPrinter::showEncapsulatedPackets
mutableprotected

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