ns3::TimeUnit< 1 > Class Template Reference

#include <nstime.h>

Collaboration diagram for ns3::TimeUnit< 1 >:
Collaboration graph
[legend]

List of all members.

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:

  • s (seconds)
  • ms (milliseconds)
  • us (microseconds)
  • ns (nanoseconds)
  • ps (picoseconds)
  • fs (femtoseconds).

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
HighPrecisionPeekHighPrecision (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

Detailed Description

template<>
class ns3::TimeUnit< 1 >

Definition at line 348 of file nstime.h.


Constructor & Destructor Documentation

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:

  • s (seconds)
  • ms (milliseconds)
  • us (microseconds)
  • ns (nanoseconds)
  • ps (picoseconds)
  • fs (femtoseconds).

There can be no white space between the numerical portion and the units. Any otherwise malformed string causes a fatal error to occur.

Parameters:
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]

Definition at line 409 of file nstime.h.

ns3::TimeUnit< 1 >::TimeUnit ( TimeUnit< 1 > const &  o  )  [inline]

Definition at line 412 of file nstime.h.

ns3::TimeUnit< 1 >::TimeUnit ( HighPrecision  data  )  [inline]

Definition at line 418 of file nstime.h.


Member Function Documentation

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
Returns:
an approximation in femtoseconds of the time stored in this instance.

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
int64_t ns3::TimeUnit< 1 >::GetMilliSeconds ( void   )  const
Returns:
an approximation in milliseconds of the time stored in this instance.

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
Returns:
an approximation in nanoseconds of the time stored in this instance.

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
Returns:
an approximation in picoseconds of the time stored in this instance.

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
int64_t ns3::TimeUnit< 1 >::GetTimeStep ( void   )  const
Returns:
an approximation of the time stored in this instance in the units specified in m_tsPrecision.

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]
bool ns3::TimeUnit< 1 >::IsPositive ( void   )  const [inline]
bool ns3::TimeUnit< 1 >::IsStrictlyNegative ( void   )  const [inline]
bool ns3::TimeUnit< 1 >::IsStrictlyPositive ( void   )  const [inline]
bool ns3::TimeUnit< 1 >::IsZero ( void   )  const [inline]
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.


Member Data Documentation

Definition at line 446 of file nstime.h.


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:12:14 2009 for NS-3 by  doxygen 1.6.3