- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Interfaces::ElapsedTimeService Class Reference

`#include <ElapsedTimeService.h>`

Inheritance diagram for Mers::Interfaces::ElapsedTimeService:

[legend]
Collaboration diagram for Mers::Interfaces::ElapsedTimeService:

[legend]
List of all members.

## Public Member Functions
| ElapsedTimeService (TimeService *tService)
virtual | ~ElapsedTimeService ()
virtual Mers::Utils::Lang::Time | elapsedTime ()
virtual double | elapsed ()
virtual void | resetTime ()
## Protected Attributes
TimeService * | mTimeService
double | mStartTime
| The base time frame that we use to compute the elapsed time.

## Detailed Description

This class represents a general set of methods of accessing and manipulating information about the amount of time that has elapsed since the creation or last reset of this class.

Author:
  Paul H. Elliott

Definition at line 33 of file ElapsedTimeService.h.

## Constructor & Destructor Documentation

ElapsedTimeService::ElapsedTimeService | ( | TimeService * | tService | ) |

Creates a new ElapsedTimeService. This class will use the TimeService tService to obtain its elapsed time information. This class uses the current time to initialize as the base for the elapsed time.

This object is reference based, and so will delete itself when all of its references have been removed. Thus, the creating application should add at least one reference before requesting the current time. The reference count starts at zero.

Parameters:

  | tService | The time service that will be used to update this entry.

Definition at line 24 of file ElapsedTimeService.cpp.

References Mers::Utils::Lang::ReferencedObject::addReference(), mTimeService, and resetTime().

Here is the call graph for this function:

ElapsedTimeService::~ElapsedTimeService | ( |  | ) | `[virtual]`

Destroys this object.

Definition at line 33 of file ElapsedTimeService.cpp.

References mTimeService, and Mers::Utils::Lang::ReferencedObject::removeReference().

Here is the call graph for this function:

## Member Function Documentation

Time ElapsedTimeService::elapsedTime | ( |  | ) | `[virtual]`

Returns the amount of time elapsed since the last reset or since creation of this object.

Returns:
  a Time object that represents the amount of time that has elapsed.

Definition at line 40 of file ElapsedTimeService.cpp.

References elapsed().

Here is the call graph for this function:

double ElapsedTimeService::elapsed | ( |  | ) | `[virtual]`

Returns the amount of time in seconds that has elapsed since the last reset or since creation of this object.

Returns:
  a double that represents the number of seconds that have elapsed.

Definition at line 52 of file ElapsedTimeService.cpp.

References mStartTime, mTimeService, and Mers::Interfaces::TimeService::time().

Referenced by elapsedTime().

Here is the call graph for this function:

void ElapsedTimeService::resetTime | ( |  | ) | `[virtual]`

Sets the current time as the base time point for future calls to elapsed and elapsedTime.

Definition at line 59 of file ElapsedTimeService.cpp.

References mStartTime, mTimeService, and Mers::Interfaces::TimeService::time().

Referenced by ElapsedTimeService().

Here is the call graph for this function:

## Member Data Documentation

TimeService* Mers::Interfaces::ElapsedTimeService::mTimeService`[protected]`

Our TimeService object. We use this to determine the current time.

Definition at line 85 of file ElapsedTimeService.h.

Referenced by elapsed(), ElapsedTimeService(), resetTime(), and ~ElapsedTimeService().

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

- /Users/fpy/titan-1-5-MBARI/Mers/Interfaces/ElapsedTimeService.h
- /Users/fpy/titan-1-5-MBARI/Mers/Interfaces/ElapsedTimeService.cpp