INET Framework for OMNeT++/OMNEST
inet::physicallayer::CommunicationLog Class Reference

#include <CommunicationLog.h>

Public Member Functions

virtual void open ()
 
virtual void close ()
 
virtual void writeTransmission (const IRadio *transmitter, const IRadioFrame *radioFrame)
 
virtual void writeReception (const IRadio *receiver, const IRadioFrame *radioFrame)
 

Protected Attributes

std::ofstream output
 

Member Function Documentation

void inet::physicallayer::CommunicationLog::close ( )
virtual

Referenced by inet::physicallayer::RadioMedium::~RadioMedium().

31 {
32  output.close();
33 }
std::ofstream output
Definition: CommunicationLog.h:33
void inet::physicallayer::CommunicationLog::open ( )
virtual

Referenced by inet::physicallayer::RadioMedium::initialize().

26 {
27  output.open(getEnvir()->getConfig()->substituteVariables("${resultdir}/${configname}-${runnumber}.tlog"));
28 }
std::ofstream output
Definition: CommunicationLog.h:33
void inet::physicallayer::CommunicationLog::writeReception ( const IRadio receiver,
const IRadioFrame radioFrame 
)
virtual

Referenced by inet::physicallayer::RadioMedium::receivePacket().

46 {
47  const ITransmission *transmission = radioFrame->getTransmission();
48  const IReception *reception = radioFrame->getReception();
49  const Radio *receiverRadio = check_and_cast<const Radio *>(receiver);
50  output << "R " << receiverRadio->getFullPath() << " " << reception->getReceiver()->getId() << " "
51  << "M " << check_and_cast<const RadioFrame *>(radioFrame)->getName() << " " << transmission->getId() << " "
52  << "S " << reception->getStartTime() << " " << reception->getStartPosition() << " -> "
53  << "E " << reception->getEndTime() << " " << reception->getEndPosition() << endl;
54 }
std::ofstream output
Definition: CommunicationLog.h:33
void inet::physicallayer::CommunicationLog::writeTransmission ( const IRadio transmitter,
const IRadioFrame radioFrame 
)
virtual

Referenced by inet::physicallayer::RadioMedium::transmitPacket().

36 {
37  const ITransmission *transmission = radioFrame->getTransmission();
38  const Radio *transmitterRadio = check_and_cast<const Radio *>(transmitter);
39  output << "T " << transmitterRadio->getFullPath() << " " << transmitterRadio->getId() << " "
40  << "M " << check_and_cast<const RadioFrame *>(radioFrame)->getName() << " " << transmission->getId() << " "
41  << "S " << transmission->getStartTime() << " " << transmission->getStartPosition() << " -> "
42  << "E " << transmission->getEndTime() << " " << transmission->getEndPosition() << endl;
43 }
std::ofstream output
Definition: CommunicationLog.h:33

Member Data Documentation

std::ofstream inet::physicallayer::CommunicationLog::output
protected

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