C12Adapter Opensource C++ Interface
|
Yearly recurrent date. More...
Public Types | |
enum | OffsetType { OffsetNo = 0, OffsetWeekdayBefore = 1, OffsetWeekdayFirstAfter = 2, OffsetWeekdaySecondAfter = 3, OffsetWeekdayThirdAfter = 4, OffsetWeekdayFourthAfter = 5, OffsetWeekdayLastAfter = 6, OffsetObserveOnThisAndFollowingDate = 7, OffsetMondayIfSunday = 8, OffsetFridayIfSunday = 9, OffsetMondayIfSaturday = 10, OffsetFridayIfSaturday = 11, OffsetMondayIfSaturdayOrSunday = 12, OffsetFridayIfSaturdayOrSunday = 13, OffsetMondayIfSundayFridayIfSaturday = 14, OffsetObserveOnFollowingDate = 15 } |
Type of the offset, which needs to be applied to modify anchor event. More... | |
Public Member Functions | |
MTimeRecurrentYearly () | |
Default constructor, recurrent time, which is midnight of the New Year. More... | |
MTimeRecurrentYearly (OffsetType offsetType, MTime::MonthType month, int dayOfMonth=1, int hour=0, int minute=0) | |
Constructor for day-based yearly time. More... | |
MTimeRecurrentYearly (OffsetType offsetType, MTime::MonthType month, int dayOfMonth, int hour, int minute, MTime::DayOfWeekType weekday) | |
Constructor for weekday-based yearly time. More... | |
MTimeRecurrentYearly (const MTimeRecurrentYearly &other) | |
Copy constructor, creates the current timezone from a copy given. More... | |
virtual | ~MTimeRecurrentYearly () |
Object destructor. | |
MTimeRecurrentYearly & | operator= (const MTimeRecurrentYearly &other) |
Assignment operator, assigns recurrent time to another. | |
bool | operator== (const MTimeRecurrentYearly &other) const |
Equality test binary operator. More... | |
bool | operator!= (const MTimeRecurrentYearly &other) const |
Inequality test binary operator. More... | |
bool | IsDayOfWeekIgnored () const |
Returns whether the recurrent time will ignore the day of week property due to offset type. | |
void | SetOnDay (OffsetType offsetType, MTime::MonthType month, int dayOfMonth, int hour=0, int minute=0) |
Set all the parameters of the recurrent day in a single call. More... | |
void | SetOnWeekday (OffsetType offsetType, MTime::MonthType month, int dayOfMonth, int hour, int minute, MTime::DayOfWeekType weekday) |
Set all the parameters of the recurrent day into weekday-based yearly time. More... | |
void | SetUnchecked (OffsetType offsetType, MTime::MonthType month, int day, int hours=0, int minutes=0, int seconds=0, MTime::DayOfWeekType weekday=MTime::WeekdaySunday) |
Set all the parameters of the recurrent yearly time in a single call. More... | |
virtual MTime | GetPertinent (const MTime &) const |
Get the time event pertinent to a given time period. More... | |
MTime | GetPertinentForYear (int year) const |
Get the time event pertinent to a given year. More... | |
virtual void | CheckIsValid () const |
Checks whether the recurrent date is valid, and whether all its values are within their proper range. More... | |
virtual void | SetToNull () |
Set this recurring time to null value, signifying that there is no recurrence defined. More... | |
virtual bool | IsNull () const |
Returns whether this recurring time is a null time, a special value, which tells that the recurring time is not initialized. More... | |
virtual MVariant | NewClone () const |
Create a reflection-enabled clone of the recurring date. More... | |
virtual unsigned | GetEmbeddedSizeof () const |
Recurrent time is an embedded object type, therefore return its size in bytes. More... | |
OffsetType | GetOffsetType () const |
void | SetOffsetType (OffsetType type) |
MTime::MonthType | GetMonth () const |
void | SetMonth (MTime::MonthType month) |
int | GetDayOfMonth () const |
void | SetDayOfMonth (int day) |
MTime::DayOfWeekType | GetDayOfWeek () const |
void | SetDayOfWeek (MTime::DayOfWeekType weekday) |
int | GetHours () const |
void | SetHours (int hours) |
int | GetMinutes () const |
void | SetMinutes (int minutes) |
int | GetSeconds () const |
void | SetSeconds (int seconds) |
![]() | |
virtual | ~MTimeRecurrent () |
Class destructor. | |
MTimeRecurrent & | operator= (const MTimeRecurrent &) |
Assignment operator. | |
bool | IsValid () const |
Tells whether the recurrent date is valid, whether it has a proper range of all its values. | |
void | CheckIfNotNull () const |
Throw an exception if the recurrent time is null. | |
![]() | |
virtual | ~MObject () |
Object destructor. | |
virtual const MClass * | GetClass () const =0 |
Get the final class of the object. More... | |
bool | IsEmbeddedObject () const |
Tell if the object is of embedded kind. More... | |
SHOW_INTERNAL MVariant | Call (const MStdString &name, const MVariant ¶ms) |
Call the object service with parameters, given as variant. More... | |
MVariant | Call0 (const MStdString &name) |
Call the object service with no parameters. More... | |
MVariant | Call1 (const MStdString &name, const MVariant &p1) |
Call the object service with one parameter. More... | |
MVariant | Call2 (const MStdString &name, const MVariant &p1, const MVariant &p2) |
Call the object service with two parameter. More... | |
MVariant | Call3 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3) |
Call the object service with three parameter. More... | |
MVariant | Call4 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4) |
Call the object service with four parameter. More... | |
MVariant | Call5 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5) |
Call the object service with five parameter. More... | |
MVariant | Call6 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5, const MVariant &p6) |
Call the object service with six parameter. More... | |
virtual MVariant | CallV (const MStdString &name, const MVariant::VariantVector ¶ms) |
Call the object service with parameters, given as variant vector. More... | |
virtual bool | IsPropertyPresent (const MStdString &name) const |
Tell if the property with the given name exists. | |
virtual bool | IsServicePresent (const MStdString &name) const |
Tell if the service with the given name exists. | |
virtual MVariant | GetProperty (const MStdString &name) const |
Get the property value using name of the property. More... | |
virtual void | SetProperty (const MStdString &name, const MVariant &value) |
Set the property using name of the property, and value. More... | |
virtual MStdStringVector | GetAllPropertyNames () const |
Return the list of publicly available properties, persistent or not. More... | |
virtual MStdStringVector | GetAllPersistentPropertyNames () const |
Return the list of persistent properties. More... | |
virtual void | SetPersistentPropertiesToDefault () |
Set the persistent properties of the object to their default values. More... | |
virtual MVariant | GetPersistentPropertyDefaultValue (const MStdString &name) const |
Get the default value of persistent property with the name given. More... | |
virtual void | SetPersistentPropertyToDefault (const MStdString &name) |
Set the persistent property with the name given to default value. More... | |
virtual const char * | GetType () const |
Get the name of the type for the object (could be the same as class name). | |
virtual void | SetType (const MStdString &) |
Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name. More... | |
virtual void | Validate () |
Validate internal structures of the object. More... | |
Additional Inherited Members | |
![]() | |
static const MClass * | GetStaticClass () |
Get the declared class of this particular object. More... | |
static bool | IsClassPresent (const MStdString &name) |
Tells if the given class name is available. More... | |
![]() | |
static const MClass | s_class |
Class of MObject. | |
![]() | |
MTimeRecurrent () | |
Default constructor. More... | |
MTimeRecurrent (const MTimeRecurrent &) | |
Copy constructor, creates the current timezone from a copy given. More... | |
![]() | |
MObject () | |
Object constructor, protected as the class is abstract. | |
void | DoSetPersistentPropertiesToDefault (const MClass *staticClass) |
Set the persistent properties to their default values for one object provided the class for that object. More... | |
Yearly recurrent date.
The date is set by an anchor date in a year, denoted by Month and Day in that month, time of the event, determined as an hour, a minute and a second.
The holiday schedule is not taken into consideration in date transformation. Also, possibility of overlapping dates, their possible merges or rearrangements is not defined. All calculations are performed in either standard time or in UTC, depending on the context. The user shall account for possible DST shift by oneself.
There is also an offset type, which determines what to do with the anchor date, whether it has to be modified at some condition.
There is a subtype of offset type, which also requires setting of a day in a week. One type sets the date of occurrence by a day in a month, like first day in month. Another type sets a certain weekday after the , like second Wednesday in January. For both major subtypes one can set modifiers, all determined by OffsetType. The type itself is wholly determined by a modifier.
When a type changes between day-of-the-month-based and day-of-the-week-based by modifying the value of OffsetType, the Day or Weekday properties morph into each other. Because of it, it is safe to set Day and Weekday properties explicitly after assignment to OffsetType. It is not correct to access a weekday property of a day of the month recurring time, or access a day property of a weekday-based recurring time.
Type of the offset, which needs to be applied to modify anchor event.
This is used only for Yearly and Monthly anchor types.
|
inline |
Default constructor, recurrent time, which is midnight of the New Year.
All fields of such object are zero, which corresponds to yearly recurrent event at January 1, 00:00.
|
inline |
Constructor for day-based yearly time.
A weekday parameter can be ignored for some recurring offset types.
offsetType | Correspondent enumeration value. |
month | Month of the recurring date. |
dayOfMonth | Day of the recurring date in the month. |
hour | Hour of the recurring date. |
minute | Minute of the recurring date. |
|
inline |
Constructor for weekday-based yearly time.
offsetType | Correspondent enumeration value. |
month | Month of the recurring date. |
dayOfMonth | Day of the recurring date in the month. |
hour | Hour of the recurring date. |
minute | Minute of the recurring date. |
weekday | Week day enumeration. |
|
inline |
Copy constructor, creates the current timezone from a copy given.
If a copy of the current timezone is made, it will no longer be automatically updated from the computer. Instead, it will stay the same as it was during time the constructor was called.
|
virtual |
Checks whether the recurrent date is valid, and whether all its values are within their proper range.
Implements MTimeRecurrent.
int MTimeRecurrentYearly::GetDayOfMonth | ( | ) | const |
Set the anchor day of the month parameter for the recurring time. For many recurring date types this is 1, first day in the month of interest.
MTime::DayOfWeekType MTimeRecurrentYearly::GetDayOfWeek | ( | ) | const |
The anchor day of the month parameter for the recurring time. For many recurring date types this is 1, first day in the month of interest.
|
virtual |
Recurrent time is an embedded object type, therefore return its size in bytes.
Reimplemented from MObject.
int MTimeRecurrentYearly::GetHours | ( | ) | const |
Hours within the day when the recurring event shall happen. Zero will mean the beginning of the day, midnight.
int MTimeRecurrentYearly::GetMinutes | ( | ) | const |
Minute within the day when the recurring event shall happen. Zero will mean the beginning of the hour.
MTime::MonthType MTimeRecurrentYearly::GetMonth | ( | ) | const |
Month parameter for the recurring time.
OffsetType MTimeRecurrentYearly::GetOffsetType | ( | ) | const |
The offset type for this yearly recurring event. The offset type tells what to do with the event if it falls to a holiday, etc. Look at OffsetType enumeration for features.
Get the time event pertinent to a given time period.
The returned time will use a given time as a hint to return the moment, which represents this recurrent event. The time given is expected to be in UTC or Standard, and the the recurring moment will be in the correspondent UTC or standard time.
For example, in case of a yearly recurring event, a given time is used to extract a year, for which the event shall be returned.
Implements MTimeRecurrent.
MTime MTimeRecurrentYearly::GetPertinentForYear | ( | int | year | ) | const |
Get the time event pertinent to a given year.
The time given is expected to be in UTC or Standard, and the the recurring moment will be in the correspondent UTC or standard time.
int MTimeRecurrentYearly::GetSeconds | ( | ) | const |
Seconds within the day when the recurring event shall happen. Zero will mean the beginning of the minute.
|
virtual |
Returns whether this recurring time is a null time, a special value, which tells that the recurring time is not initialized.
This implementation overrides the pure virtual defined in the base class.
Implements MTimeRecurrent.
|
virtual |
Create a reflection-enabled clone of the recurring date.
Variant returned has a recurring date embedded it it, one which shall not be deleted because it does not allocate memory outside of variant.
Implements MTimeRecurrent.
|
inline |
Inequality test binary operator.
Two recurrent times are not equal if any of their rules are not equal.
|
inline |
Equality test binary operator.
Two recurrent times are equal if all their rules are equal.
void MTimeRecurrentYearly::SetDayOfMonth | ( | int | day | ) |
Set the anchor day of the month parameter for the recurring time. For many recurring date types this is 1, first day in the month of interest.
void MTimeRecurrentYearly::SetDayOfWeek | ( | MTime::DayOfWeekType | weekday | ) |
The anchor day of the month parameter for the recurring time. For many recurring date types this is 1, first day in the month of interest.
void MTimeRecurrentYearly::SetHours | ( | int | hours | ) |
Hours within the day when the recurring event shall happen. Zero will mean the beginning of the day, midnight.
void MTimeRecurrentYearly::SetMinutes | ( | int | minutes | ) |
Minute within the day when the recurring event shall happen. Zero will mean the beginning of the hour.
void MTimeRecurrentYearly::SetMonth | ( | MTime::MonthType | month | ) |
Month parameter for the recurring time.
void MTimeRecurrentYearly::SetOffsetType | ( | OffsetType | type | ) |
The offset type for this yearly recurring event. The offset type tells what to do with the event if it falls to a holiday, etc. Look at OffsetType enumeration for features.
void MTimeRecurrentYearly::SetOnDay | ( | OffsetType | offsetType, |
MTime::MonthType | month, | ||
int | dayOfMonth, | ||
int | hour = 0 , |
||
int | minute = 0 |
||
) |
Set all the parameters of the recurrent day in a single call.
offsetType | Correspondent enumeration value. |
month | Month of the recurring date. |
dayOfMonth | Day of the recurring date in the month. |
hour | Hour of the recurring date. |
minute | Minute of the recurring date. |
void MTimeRecurrentYearly::SetOnWeekday | ( | OffsetType | offsetType, |
MTime::MonthType | month, | ||
int | dayOfMonth, | ||
int | hour, | ||
int | minute, | ||
MTime::DayOfWeekType | weekday | ||
) |
Set all the parameters of the recurrent day into weekday-based yearly time.
offsetType | Correspondent enumeration value. |
month | Month of the recurring date. |
dayOfMonth | Day of the recurring date in the month. |
hour | Hour of the recurring date. |
minute | Minute of the recurring date. |
weekday | Week day enumeration. |
void MTimeRecurrentYearly::SetSeconds | ( | int | seconds | ) |
Seconds within the day when the recurring event shall happen. Zero will mean the beginning of the minute.
|
virtual |
Set this recurring time to null value, signifying that there is no recurrence defined.
This implementation overrides the pure virtual defined in the base class.
Implements MTimeRecurrent.
|
inline |
Set all the parameters of the recurrent yearly time in a single call.