base::Seconds Struct Reference

Time units. More...

#include <base_types.hh>

List of all members.

Public Types

typedef int64 Int

Public Member Functions

 Seconds (void)
 Seconds (Int secs)
 operator Int () const

Private Attributes

Int mSeconds

Friends

Seconds operator+ (const Seconds &a, const Seconds &b)
Seconds operator- (const Seconds &a, const Seconds &b)


Detailed Description

Time units.

/// Examples:
/// Milliseconds(Second(secs))        // convert seconds to milliseconds
///
/// Avoid explicit casting to int.  If that's necessary, cast to typedef Int.
/// Instead of casting to int to do arithmetic, cast to Milliseconds to use
/// the operator() arithmetic methods.  operator Int() can automatically
/// produce an integer.
///
/// int droppedFrames = int64(mMillisecFrame) / int64(mMillisecTimer) - 1;  // BAD
/// int droppedFrames = mMillisecFrame / mMillisecTimer - Milliseconds(1);  // better
/// Milliseconds t = Max( int(millisec1), int(millisec2) );                 // BAD
/// Milliseconds t = Max<Milliseconds::Int>( millisec1, millisec2 );        // better
///
/// int64 was chosen to avoid overflow.  uint64 wasn't chosen
/// since there's a need to compute negative time units.
/// 

Member Typedef Documentation

typedef int64 base::Seconds::Int


Constructor & Destructor Documentation

base::Seconds::Seconds ( void   )  [inline]

base::Seconds::Seconds ( Int  secs  )  [inline]


Member Function Documentation

base::Seconds::operator Int (  )  const [inline]


Friends And Related Function Documentation

Seconds operator+ ( const Seconds a,
const Seconds b 
) [friend]

Seconds operator- ( const Seconds a,
const Seconds b 
) [friend]


Member Data Documentation

Int base::Seconds::mSeconds [private]


The documentation for this struct was generated from the following file: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:20 2007