#include <nstime.h>
Public Member Functions | |
TimeUnit (const std::string &s) | |
String constructor Construct TimeUnit<1> object from common time expressions like "
1ms" or "10s". Supported units include:
| |
double | GetSeconds (void) const |
int64_t | GetMilliSeconds (void) const |
int64_t | GetMicroSeconds (void) const |
int64_t | GetNanoSeconds (void) const |
int64_t | GetPicoSeconds (void) const |
int64_t | GetFemtoSeconds (void) const |
int64_t | GetTimeStep (void) const |
TimeUnit () | |
TimeUnit (TimeUnit const &o) | |
TimeUnit | operator= (TimeUnit const &o) |
TimeUnit (HighPrecision data) | |
bool | IsZero (void) const |
bool | IsNegative (void) const |
bool | IsPositive (void) const |
bool | IsStrictlyNegative (void) const |
bool | IsStrictlyPositive (void) const |
HighPrecision const & | GetHighPrecision (void) const |
HighPrecision * | PeekHighPrecision (void) |
Static Public Member Functions | |
static uint64_t | UnitsToTimestep (uint64_t unitValue, uint64_t unitFactor) |
Private Member Functions | |
int64_t | ConvertToUnits (int64_t timeValue, uint64_t unitFactor) const |
Private Attributes | |
HighPrecision | m_data |
Definition at line 348 of file nstime.h.
ns3::TimeUnit< 1 >::TimeUnit | ( | const std::string & | s | ) |
String constructor Construct TimeUnit<1> object from common time expressions like " 1ms" or "10s". Supported units include:
There can be no white space between the numerical portion and the units. Any otherwise malformed string causes a fatal error to occur.
s | The string to parse into a TimeUnit<1> |
Definition at line 70 of file time.cc.
References ns3::TimeStepPrecision::g_tsPrecFactor, ns3::TimeUnit< N >::m_data, and NS_FATAL_ERROR.
ns3::TimeUnit< 1 >::TimeUnit | ( | ) | [inline] |
ns3::TimeUnit< 1 >::TimeUnit | ( | TimeUnit< 1 > const & | o | ) | [inline] |
ns3::TimeUnit< 1 >::TimeUnit | ( | HighPrecision | data | ) | [inline] |
int64_t ns3::TimeUnit< 1 >::ConvertToUnits | ( | int64_t | timeValue, | |
uint64_t | unitFactor | |||
) | const [private] |
Definition at line 134 of file time.cc.
References ns3::TimeStepPrecision::g_tsPrecFactor.
int64_t ns3::TimeUnit< 1 >::GetFemtoSeconds | ( | void | ) | const |
Definition at line 185 of file time.cc.
References ns3::TimeStepPrecision::FS_FACTOR.
Referenced by ns3::TimeTests::CheckConversions().
HighPrecision const& ns3::TimeUnit< 1 >::GetHighPrecision | ( | void | ) | const [inline] |
Definition at line 435 of file nstime.h.
References ns3::TimeUnit< N >::m_data.
int64_t ns3::TimeUnit< 1 >::GetMicroSeconds | ( | void | ) | const |
Definition at line 161 of file time.cc.
References ns3::TimeStepPrecision::US_FACTOR.
Referenced by ns3::TimeTests::CheckConversions(), ns3::NscTcpL4Protocol::gettime(), ns3::NqapWifiMac::SendOneBeacon(), ns3::NqapWifiMac::SendProbeResp(), ns3::WifiMacHeader::SetDuration(), and ns3::PcapWriter::WritePacket().
int64_t ns3::TimeUnit< 1 >::GetMilliSeconds | ( | void | ) | const |
Definition at line 153 of file time.cc.
References ns3::TimeStepPrecision::MS_FACTOR.
Referenced by ns3::TimeTests::CheckConversions().
int64_t ns3::TimeUnit< 1 >::GetNanoSeconds | ( | void | ) | const |
Definition at line 169 of file time.cc.
References ns3::TimeStepPrecision::NS_FACTOR.
Referenced by ns3::TimeTests::CheckConversions(), and ns3::SimulatorTests::NowUs().
int64_t ns3::TimeUnit< 1 >::GetPicoSeconds | ( | void | ) | const |
Definition at line 177 of file time.cc.
References ns3::TimeStepPrecision::PS_FACTOR.
Referenced by ns3::TimeTests::CheckConversions().
double ns3::TimeUnit< 1 >::GetSeconds | ( | void | ) | const |
Definition at line 127 of file time.cc.
References ns3::TimeStepPrecision::g_tsPrecFactor, ns3::HighPrecision::GetDouble(), and ns3::TimeUnit< N >::GetHighPrecision().
Referenced by ns3::EmuHelper::AsciiDequeueEvent(), ns3::EmuHelper::AsciiDropEvent(), ns3::EmuHelper::AsciiEnqueueEvent(), ns3::EmuHelper::AsciiRxEvent(), ns3::InterferenceHelper::CalculateChunkSuccessRate(), ns3::TimeTests::CheckConversions(), ns3::TimeTests::CheckOld(), ns3::TimeTests::CheckOperations(), ns3::RandomWalk2dMobilityModel::DoWalk(), ns3::JakesPropagationLossModel::PathCoefficients::GetLoss(), ns3::olsr::AgentImpl::LinkSensing(), ns3::olsr::MessageHeader::Hello::SetHTime(), ns3::olsr::MessageHeader::SetVTime(), ns3::TimePrinter(), ns3::CsmaNetDevice::TransmitCompleteEvent(), ns3::CsmaChannel::TransmitEnd(), ns3::PointToPointNetDevice::TransmitStart(), ns3::CsmaNetDevice::TransmitStart(), and ns3::StaticSpeedHelper::Update().
int64_t ns3::TimeUnit< 1 >::GetTimeStep | ( | void | ) | const |
This returns the value with the precision returned by TimeStepPrecision::Get
Definition at line 197 of file time.cc.
References ns3::TimeUnit< N >::GetHighPrecision(), and ns3::HighPrecision::GetInteger().
Referenced by ns3::operator<<(), ns3::SqliteDataOutput::SqliteOutputCallback::OutputSingleton(), ns3::RealtimeSimulatorImpl::ProcessOneEvent(), ns3::RealtimeSimulatorImpl::Schedule(), ns3::DefaultSimulatorImpl::Schedule(), and ns3::RealtimeSimulatorImpl::ScheduleRealtime().
bool ns3::TimeUnit< 1 >::IsNegative | ( | void | ) | const [inline] |
Definition at line 423 of file nstime.h.
References ns3::HighPrecision::Compare(), ns3::TimeUnit< N >::m_data, and ns3::HighPrecision::Zero().
Referenced by ns3::TimeTests::RunTests().
bool ns3::TimeUnit< 1 >::IsPositive | ( | void | ) | const [inline] |
Definition at line 426 of file nstime.h.
References ns3::HighPrecision::Compare(), ns3::TimeUnit< N >::m_data, and ns3::HighPrecision::Zero().
Referenced by ns3::RealtimeSimulatorImpl::Schedule(), ns3::DefaultSimulatorImpl::Schedule(), and ns3::OnOffApplication::ScheduleNextTx().
bool ns3::TimeUnit< 1 >::IsStrictlyNegative | ( | void | ) | const [inline] |
Definition at line 429 of file nstime.h.
References ns3::HighPrecision::Compare(), ns3::TimeUnit< N >::m_data, and ns3::HighPrecision::Zero().
Referenced by ns3::TimeTests::CheckOld().
bool ns3::TimeUnit< 1 >::IsStrictlyPositive | ( | void | ) | const [inline] |
Definition at line 432 of file nstime.h.
References ns3::HighPrecision::Compare(), ns3::TimeUnit< N >::m_data, and ns3::HighPrecision::Zero().
Referenced by ns3::TimeTests::CheckOld().
bool ns3::TimeUnit< 1 >::IsZero | ( | void | ) | const [inline] |
Definition at line 420 of file nstime.h.
References ns3::HighPrecision::Compare(), ns3::TimeUnit< N >::m_data, and ns3::HighPrecision::Zero().
Referenced by ns3::TimeTests::CheckOld(), ns3::YansWifiPhy::StartReceivePacket(), and ns3::Ns2ExtWifiPhy::StartReceivePacket().
TimeUnit ns3::TimeUnit< 1 >::operator= | ( | TimeUnit< 1 > const & | o | ) | [inline] |
Definition at line 414 of file nstime.h.
References ns3::TimeUnit< N >::m_data.
HighPrecision* ns3::TimeUnit< 1 >::PeekHighPrecision | ( | void | ) | [inline] |
Definition at line 438 of file nstime.h.
References ns3::TimeUnit< N >::m_data.
uint64_t ns3::TimeUnit< 1 >::UnitsToTimestep | ( | uint64_t | unitValue, | |
uint64_t | unitFactor | |||
) | [static] |
Definition at line 293 of file time.cc.
References ns3::TimeStepPrecision::g_tsPrecFactor.
HighPrecision ns3::TimeUnit< 1 >::m_data [private] |