A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.

Private Attributes

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

Friends

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

Detailed Description

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

Definition at line 1499 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 1508 of file nstime.h.

References m_time, and m_unit.

Referenced by operator<<.

Here is the caller graph for this function:

◆ 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 421 of file time.cc.

References TimeWithUnit(), ns3::Time::AUTO, ns3::Time::D, ns3::Time::FS, ns3::Time::GetResolution(), ns3::Time::GetTimeStep(), ns3::Time::H, ns3::Time::LAST, m_time, m_unit, ns3::Time::MIN, ns3::Time::MS, ns3::Time::NS, NS_ABORT_MSG, ns3::Time::PS, ns3::Time::S, ns3::Time::ToDouble(), u, ns3::Time::US, v, and ns3::Time::Y.

Member Data Documentation

◆ m_time

Time ns3::TimeWithUnit::m_time
private

The time.

Definition at line 1515 of file nstime.h.

Referenced by TimeWithUnit(), and operator<<.

◆ m_unit

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

The unit to use in output.

Definition at line 1516 of file nstime.h.

Referenced by TimeWithUnit(), and operator<<.


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