• TimeDescriptor
  • TimeDescriptor Class

    (nymeaserver::TimeDescriptor)

    Describes the time elements of a time based Rule. More...

    Header: #include <TimeDescriptor>

    Public Functions

    TimeDescriptor()
    QList<CalendarItem> calendarItems() const
    bool evaluate(const QDateTime & lastEvaluationTime, const QDateTime & dateTime) const
    bool isEmpty() const
    bool isValid() const
    void setCalendarItems(const QList<CalendarItem> & calendarItems)
    void setTimeEventItems(const QList<TimeEventItem> & timeEventItems)
    QList<TimeEventItem> timeEventItems() const

    Detailed Description

    Describes the time elements of a time based Rule.

    A time based rule can be described with a TimeDescriptor. The TimeDescriptor can have either a list of TimeEventItems or a list of CalendarItems, never both.

    See also Rule, TimeEventItem, and CalendarItem.

    Member Function Documentation

    TimeDescriptor::TimeDescriptor()

    Constructs an invalid TimeDescriptor.

    QList<CalendarItem> TimeDescriptor::calendarItems() const

    Returns the list of CalendarItems of this TimeDescriptor.

    See also setCalendarItems().

    bool TimeDescriptor::evaluate(const QDateTime & lastEvaluationTime, const QDateTime & dateTime) const

    Returns true if this TimeDescriptor is valid for the given dateTime. A TimeDescriptor is valid if the TimeEventItems or CalendarItems match the given dateTime since the lastEvaluationTime.

    bool TimeDescriptor::isEmpty() const

    Returns true if the calendarItems list and the timeEventItems list is empty.

    bool TimeDescriptor::isValid() const

    Returns true if either the calendarItems list is not empty or the timeEventItems list.

    void TimeDescriptor::setCalendarItems(const QList<CalendarItem> & calendarItems)

    Set the list of CalendarItems of this TimeDescriptor to the given calendarItems.

    See also calendarItems().

    void TimeDescriptor::setTimeEventItems(const QList<TimeEventItem> & timeEventItems)

    Set the list of TimeEventItems of this TimeDescriptor to the given timeEventItems.

    See also timeEventItems().

    QList<TimeEventItem> TimeDescriptor::timeEventItems() const

    Returns the list of TimeEventItems of this TimeDescriptor.

    See also setTimeEventItems().