7.7.7 sg::Timer class

This section describes the Timer interface class. The SchedulerInterfaceForComponents::createTimer() method creates Timer objects.

sg::Timer::cancel

This method unsets the timer so that it does not fire.

void cancel();

If the timer is not set, this method has no effect.

sg::Timer::destructor

This method destroys Timer objects.

~Timer();

The timer must not call TimerCallback::timerCallback() after the destruction of this object.

sg::Timer::getName

This method returns the name of the instance that owns the object.

const char *getName() const;

This is the name that createTimer() received.

Timer inherits this method from sg::SchedulerObject.

sg::Timer::isSet

This method returns true if the timer is set and queued for call-back, otherwise false.

bool isSet();

This method has no side effects.

sg::Timer::remaining

This method requests the remaining number of ticks relative to simulated time resolution until a timer makes a signal.

ticks_t remaining();

This method returns 0 if there are no ticks remaining or if the timer is not set.

This method has no side effects.

sg::Timer::set

This method sets a timer to make a signal.

bool set(ticks_t ticks);
ticks
the number of ticks after which the timer is to make a signal.

The signal that this method makes is a call to the user call-back function. If the return value t is 0, the timer does not repeat, otherwise it repeats after t ticks. The latest set() overrides the previous one.

This method returns false if ticks is too big to schedule the timer.

sg::Timer::setFrequency

This method sets the frequency source clock for the timer. ARM deprecates this v0 function. Simulated time is now relative to global time resolution. See SchedulerInterfaceForComponents::getSimulatedTimeResolution() and SchedulerInterfaceForComponents::setSimulatedTimeResolution().

Non-ConfidentialPDF file icon PDF versionARM 100965_1101_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.