A Discrete-Event Network Simulator
API
ns3::TimeWithUnit Class Reference

A Time with attached unit, to facilitate output in that unit. More...

#include "nstime.h"

+ Collaboration diagram for ns3::TimeWithUnit:

Public Member Functions

 TimeWithUnit (const Time time, const Time::Unit unit)
 Attach a unit to a Time. More...
 

Private Attributes

Time m_time
 The time. More...
 
Time::Unit m_unit
 The unit to use in output. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const TimeWithUnit &timeU)
 Output streamer. More...
 

Detailed Description

A Time with attached unit, to facilitate output in that unit.

Definition at line 1456 of file nstime.h.

Constructor & Destructor Documentation

◆ TimeWithUnit()

ns3::TimeWithUnit::TimeWithUnit ( const Time  time,
const Time::Unit  unit 
)
inline

Attach a unit to a Time.

Parameters
[in]timeThe time.
[in]unitThe unit to use for output

Definition at line 1465 of file nstime.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const TimeWithUnit timeU 
)
friend

Output streamer.

Parameters
[in,out]osThe stream.
[in]timeUThe Time with desired unit
Returns
The stream.

Definition at line 427 of file time.cc.

Member Data Documentation

◆ m_time

Time ns3::TimeWithUnit::m_time
private

The time.

Definition at line 1472 of file nstime.h.

◆ m_unit

Time::Unit ns3::TimeWithUnit::m_unit
private

The unit to use in output.

Definition at line 1473 of file nstime.h.


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