The Pedigree Project  0.1
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Timer Class Referenceabstract

#include <Timer.h>

+ Inheritance diagram for Timer:
+ Collaboration diagram for Timer:

Public Member Functions

virtual size_t getYear ()=0
 
virtual uint8_t getMonth ()=0
 
virtual uint8_t getDayOfMonth ()=0
 
virtual uint8_t getDayOfWeek ()=0
 
virtual uint8_t getHour ()=0
 
virtual uint8_t getMinute ()=0
 
virtual uint8_t getSecond ()=0
 
virtual uint64_t getNanosecond ()=0
 
virtual uint64_t getTickCount ()=0
 
virtual uint64_t getTickCountNano ()
 
virtual Time::Timestamp getUnixTimestamp ()
 
virtual bool registerHandler (TimerHandler *handler)=0
 
virtual bool unregisterHandler (TimerHandler *handler)=0
 
virtual void addAlarm (class Event *pEvent, size_t alarmSecs, size_t alarmUsecs=0)=0
 
virtual void removeAlarm (class Event *pEvent)=0
 
virtual size_t removeAlarm (class Event *pEvent, bool bRetZero)=0
 
virtual void synchronise (bool tohw=false)
 Synchronises the timer with the hardware. Useful for updating the fields returned by get*, especially if IRQs are not enabled. More...
 

Protected Member Functions

 Timer ()
 
virtual ~Timer ()
 

Private Member Functions

 Timer (const Timer &)
 
Timeroperator= (const Timer &)
 

Detailed Description

Timer for the time-keeping

Definition at line 32 of file include/pedigree/kernel/machine/Timer.h.

Constructor & Destructor Documentation

Timer::Timer ( )
inlineprotected

The default constructor

Definition at line 104 of file include/pedigree/kernel/machine/Timer.h.

Referenced by ~Timer().

+ Here is the caller graph for this function:

virtual Timer::~Timer ( )
inlineprotectedvirtual

The destructor

Definition at line 108 of file include/pedigree/kernel/machine/Timer.h.

References operator=(), and Timer().

Timer::Timer ( const Timer )
private

The copy-constructor

Note
NOT implemented

Member Function Documentation

virtual void Timer::addAlarm ( class Event pEvent,
size_t  alarmSecs,
size_t  alarmUsecs = 0 
)
pure virtual

Dispatches the Event pEvent to the current thread in alarmSecs time.

Parameters
pEventEvent to dispatch.
alarmSecsNumber of seconds to wait.

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by Semaphore::acquireWithResult(), getTickCountNano(), and TimeoutGuard::TimeoutGuard().

+ Here is the caller graph for this function:

virtual uint8_t Timer::getDayOfMonth ( )
pure virtual

Get the current day of month

Returns
the current day of month

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by getUnixTimestamp().

+ Here is the caller graph for this function:

virtual uint8_t Timer::getDayOfWeek ( )
pure virtual

Get the current day of week

Returns
the current day of week

Implemented in GPTimer, Rtc, and HostedTimer.

virtual uint8_t Timer::getHour ( )
pure virtual

Get the current hour

Returns
the current hour

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by getUnixTimestamp().

+ Here is the caller graph for this function:

virtual uint8_t Timer::getMinute ( )
pure virtual

Get the current minute

Returns
the current minute

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by getUnixTimestamp().

+ Here is the caller graph for this function:

virtual uint8_t Timer::getMonth ( )
pure virtual

Get the current month

Returns
the current month

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by getUnixTimestamp().

+ Here is the caller graph for this function:

virtual uint64_t Timer::getNanosecond ( )
pure virtual

Get the current nanosecond

Returns
the current nanosecond

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by WaitCleanup::terminated().

+ Here is the caller graph for this function:

virtual uint8_t Timer::getSecond ( )
pure virtual

Get the current second

Returns
the current second

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by getUnixTimestamp().

+ Here is the caller graph for this function:

virtual uint64_t Timer::getTickCount ( )
pure virtual

Get the Tick count (time elapsed since system bootup)

Returns
the tick count in milliseconds

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by getTickCountNano(), Log::LogEntry::operator<<(), and UptimeFile::writeBytewise().

+ Here is the caller graph for this function:

virtual uint64_t Timer::getTickCountNano ( )
inlinevirtual

Get the Tick count (time elapsed since system bootup) in nanosconds.

Returns
the tick count in nanoseconds

Reimplemented in Rtc, and HostedTimer.

Definition at line 65 of file include/pedigree/kernel/machine/Timer.h.

References addAlarm(), getTickCount(), getUnixTimestamp(), and removeAlarm().

Time::Timestamp Timer::getUnixTimestamp ( )
virtual

Get the time in UNIX timestamp form (seconds since Jan 1st, 1970).

Definition at line 23 of file Timer.cc.

References getDayOfMonth(), getHour(), getMinute(), getMonth(), getSecond(), and getYear().

Referenced by getTickCountNano(), and WaitCleanup::terminated().

+ Here is the caller graph for this function:

virtual size_t Timer::getYear ( )
pure virtual

Get the current year

Returns
the current year

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by getUnixTimestamp().

+ Here is the caller graph for this function:

Timer& Timer::operator= ( const Timer )
private

The assignment operator

Note
NOT implemented

Referenced by ~Timer().

+ Here is the caller graph for this function:

virtual void Timer::removeAlarm ( class Event pEvent)
pure virtual

Removes the event pEvent from the alarm queue.

Parameters
pEventEvent to remove alarm for.

Implemented in GPTimer, Rtc, and HostedTimer.

Referenced by Semaphore::acquireWithResult(), getTickCountNano(), and TimeoutGuard::~TimeoutGuard().

+ Here is the caller graph for this function:

virtual size_t Timer::removeAlarm ( class Event pEvent,
bool  bRetZero 
)
pure virtual

Removes the event pEvent from the alarm queue.

Parameters
pEventEvent to remove alarm for.
bRetZeroIf true, returns zero rather the time until firing
Returns
The number of seconds before the event would have fired, or zero if bRetZero is true.

Implemented in GPTimer, Rtc, and HostedTimer.

virtual void Timer::synchronise ( bool  tohw = false)
inlinevirtual

Synchronises the timer with the hardware. Useful for updating the fields returned by get*, especially if IRQs are not enabled.

Parameters
tohwIf true, syncs back to the hardware, instead of from it.

Reimplemented in Rtc, and HostedTimer.

Definition at line 98 of file include/pedigree/kernel/machine/Timer.h.


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