TTsTime Class Reference

#include <schtime.h>

class TTsTime
Public Member Functions
TTsTime()
TTsTime(const TTime &, TBool)
TTsTime(const TTsTime &)
voidExternalizeL(RWriteStream &)
IMPORT_C const TTimeGetLocalTime()
IMPORT_C TTimeGetLocalTime()
TTimeIntervalSeconds GetOffset()
IMPORT_C const TTime &GetUtcTime()
IMPORT_C const TTime &GetUtcTime()
voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsUtc()
voidProcessOffsetEvent()
IMPORT_C voidSetLocalTime(const TTime &)
IMPORT_C voidSetUtcTime(const TTime &)
IMPORT_C TTsTime &operator=(const TTsTime &)

Detailed Description

In Task Scheduler TTsTime is used to represent time as either UTC or Local Time. It is used by many of the Task Scheduler API's and also used internally within Task Scheduler. This class is not expected to be stored by Task Scheduler clients.

It provides EXPORTed APIs for constructing, setting and getting UTC and Local Time.

Internally the object always holds time as UTC (using the data member iUTC) irrespective of whether the object is local time based or UTC based.

If the object is local time based iOffset will be set to the system TimeZone/DST offset. When UTC based iOffset will always be 0.

Therefore:

When representing UTC: iUTC contains the UTC time iOffSet is set to 0 iFlags, bit 0 is set to 1

When representing Local Time: iUTC contains the home time minus the TimeZone/DST offset iOffSet contains the TimeZone/DST offset iFlags, bit 0 is set to 0

If an instance of this class is created using the default constructor then: iUTC is set to 0 iOffSet is set to 0 iFlags, bit 0 is set to 1 (indicating UTC time)

Constructor & Destructor Documentation

TTsTime ( )

IMPORT_CTTsTime()

Default constructor for TTsTime. This constructor initialises its member data to zero. By default this sets it to be UTC based.

TTsTime ( const TTime &, TBool )

IMPORT_CTTsTime(const TTime &aTime,
TBoolaIsUtc
)

Constructs a TTsTime with a TTime. If the iIsUtc is ETrue, then TTsTime is UTC based time, if iIsUtc is EFalse then TTsTime is local time based. This constructor will update all the member data as appropriate.

Parameters
aTimeThe TTime value
aIsUtcis Etrue when aTime is UTC and EFalse when aTime is local time.

TTsTime ( const TTsTime & )

IMPORT_CTTsTime(const TTsTime &aTTsTime)

Copy constructor for TTsTime

Parameters
aTTsTimevalue to duplicate

Member Function Documentation

ExternalizeL ( RWriteStream & )

voidExternalizeL(RWriteStream &aStream)const

Uses the standard template operator>>() to externalize the object to aStream

GetLocalTime ( )

IMPORT_C const TTimeGetLocalTime()

This function returns a home time value.

Return Value
Retrieves time from object in local time

GetLocalTime ( )

IMPORT_C TTimeGetLocalTime()const

This function returns a home time value.

Return Value
Retrieves time from object in local time

GetOffset ( )

TTimeIntervalSeconds GetOffset()[inline]

This method must only be used by Task Scheduler itself as it returns raw offset data that can become out of date if system Timezone/DST changes occur.

GetUtcTime ( )

IMPORT_C const TTime &GetUtcTime()

This function returns a UTC value.

Return Value
Returns the UTC time value.

GetUtcTime ( )

IMPORT_C const TTime &GetUtcTime()const

This function returns a UTC value.

Return Value
Returns the UTC time value.

InternalizeL ( RReadStream & )

voidInternalizeL(RReadStream &aStream)

Uses the standard template operator>>() to internalize the object from aStream. Additionally this method will ensure that the object is updated in the event that the system TimeZone/DST offset changed since it was externalised.

IsUtc ( )

IMPORT_C TBoolIsUtc()const

Return Value
ETrue, if TTsTime object is UTC and EFalse if TTsTime object is local time

ProcessOffsetEvent ( )

voidProcessOffsetEvent()

This class does not explicitly update iOffSet if the system TimeZone/DST offset changes. When called this API will update the object if the system TimeZone/DST offset has changed. Keeping the offset in objects of this class correct is the responsibility of the Task Scheduler server.This applies to local time objects only. UTC objects will be unaffected.

SetLocalTime ( const TTime & )

IMPORT_C voidSetLocalTime(const TTime &aLocalTime)

Sets this object to a local time based value updating its parameters as appropriate.

Parameters
aLocalTimeThe local time to be set.

SetUtcTime ( const TTime & )

IMPORT_C voidSetUtcTime(const TTime &aUtcTime)

Sets this object to a UTC time based value updating its parameters as appropriate.

Parameters
aUtcTimeThe UTC time to be set

operator= ( const TTsTime & )

IMPORT_C TTsTime &operator=(const TTsTime &aTsTime)

Overloaded assignment operator for TTsTime

Parameters
aTsTimetime value to copy