Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TCalendar
Inherited By:
None.
Purpose:
A concrete derived class of TCalendar. It is the default calendar used in most of the world.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
TGregorianCalendar is a concrete class designed to be used directly.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
- TGregorianCalendar ()
- TGregorianCalendar (const TGregorianCalendar & GCal)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
~ TGregorianCalendar ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void GetLimits (DateTimeFieldType whichField, DateTimeFieldValue & minValue, DateTimeFieldValue & maxValue, DateTimeFieldValue & smallestMaxValue) const
Interface Category:
API.
Purpose:
Returns the range of valid values for a given field. Also returns the smallest maximal value possible. For example, for the month field, the valid range is (1,31); the smallest maximal value is 28.
Calling Context:
Call this function directly.
Parameters:
- DateTimeFieldType whichField -The field designator (for example, kDayInMonth).
- DateTimeFieldValue & minValue -The minimum valid value for this field (for example, 1).
- DateTimeFieldValue & maxValue -The maximum valid value for this field (for example, 31).
- DateTimeFieldValue & smallestMaxValue -The lower maximum limit for this field (for example, 28 for February).
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TGregorianCalendar & operator =(const TGregorianCalendar & calendar)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object is streamed in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object is streamed out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void DaysToDate (DateTimeFieldValue days)
Interface Category:
API.
Purpose:
Converts the number of days into era, year, month, and day, and sets these fields in this calendar.
Calling Context:
Called internally by SetTime.
Parameters:
- DateTimeFieldValue days -An integral number of days.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual DateTimeFieldValue DateToDays () const
Interface Category:
API.
Purpose:
Converts the era, year, month, and day fields into a number of days, and returns this value.
Calling Context:
Called internally by GetTime.
Parameters:
Return Value:
Returns an integral number of days.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool IsValidDate (DateTimeFieldType & badField) const
Interface Category:
API.
Purpose:
Determines if the fields in the calendar are consistent with each other. Returns the first invalid field found.
Calling Context:
Called internally by SetField.
Parameters:
- DateTimeFieldType & badField -The first invalid field encountered.
Return Value:
Returns true if all fields are valid.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TGregorianCalendar::ClearConflictingFields
virtual void ClearConflictingFields (DateTimeFieldType whichField)
Interface Category:
API.
Purpose:
Clears fields that are in conflict with the field just set. For example, when trying to set kDayInYear in a Gregorian calendar, the conflicting fields to clear are: kDayInMonth, kMonthInYear, kWeekInYear, and kDayInWeek, because just kDayInYear is good enough to uniquely specify a day.
Calling Context:
Called internally by SetField and RollField.
Parameters:
- DateTimeFieldType whichField -The field that you want to set.
Return Value:
None.
Exceptions:
Throws an exception if whichField is out of bounds.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void BoundFieldToLimit (DateTimeFieldType whichField)
Interface Category:
API.
Purpose:
This function binds the value in a particular field to its closest limit. For example, if the field value is greater than the maximum allowed, it is changed to the maximal value.
Calling Context:
Called internally by the field-changing public functions SetField, RollField, and ShiftField.
Parameters:
- DateTimeFieldType whichField -The field to bind to its limit.
Return Value:
None.
Exceptions:
Throws an exception if whichField is out of bounds.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TGregorianCalendar::ResolveConflictingFields
virtual void ResolveConflictingFields ()
Interface Category:
API.
Purpose:
Called by the public field manipulation functions to resolve conflicting values. For example, the user might have set the month to 4 and the day to 31. The resolution scheme it provides is based on field priority (see GetFieldPriority).
Calling Context:
Called internally by SetField, RollField, and ShiftField.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual DateTimeFieldPriority GetFieldPriority (DateTimeFieldType whichField) const
Interface Category:
API.
Purpose:
Returns the priority for a given field where the highest priority has a value of zero. The priority is used in resolving conflicting fields.
Calling Context:
Called internally by SetField and RollField.
Parameters:
- DateTimeFieldType whichField -The field to get the priority for.
Return Value:
The field priority.
Exceptions:
Throws an exception if whichField is out of bounds.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.