|
hueplusplus 1.2.0
|
Holds different time representations. More...
#include <hueplusplus/TimePattern.h>
Collaboration diagram for hueplusplus::time::TimePattern:Public Types | |
| enum class | Type { undefined , absolute , recurring , interval , timer } |
| Currently active type. More... | |
Public Member Functions | |
| TimePattern () | |
| Create empty TimePattern. | |
| ~TimePattern () | |
| Destructor for union. | |
| TimePattern (const AbsoluteVariedTime &absolute) | |
| Create TimePattern from AbsoluteVariedTime. | |
| TimePattern (const RecurringTime &recurring) | |
| Create TimePattern from RecurringTime. | |
| TimePattern (const TimeInterval &interval) | |
| Create TimePattern from TimeInterval. | |
| TimePattern (const Timer &timer) | |
| Create TimePattern from Timer. | |
| TimePattern (const TimePattern &other) | |
| Copy constructor for union. | |
| TimePattern & | operator= (const TimePattern &other) |
| Copy assignment for union. | |
| Type | getType () const |
| Get currently active type. | |
| AbsoluteVariedTime | asAbsolute () const |
| Get contained absolute time. | |
| RecurringTime | asRecurring () const |
| Get contained recurring time. | |
| TimeInterval | asInterval () const |
| Get contained time interval. | |
| Timer | asTimer () const |
| Get contained timer. | |
| std::string | toString () const |
| Get formatted string of the contained value as expected by Hue API. | |
Static Public Member Functions | |
| static TimePattern | parse (const std::string &s) |
| Parses TimePattern from formatted string as returned by Hue API. | |
Holds different time representations.
Holds either AbsoluteTime, RecurringTime, TimeInterval, Timer or an undefined state. TimePattern is used to specify the occurrance of Schedules.
|
strong |
Currently active type.
| Enumerator | |
|---|---|
| undefined | No active type. |
| absolute | Active type is AbsoluteVariedTime. |
| recurring | Active type is RecurringTime. |
| interval | Active type is TimeInterval. |
| timer | Active type is Timer. |
| hueplusplus::time::TimePattern::TimePattern | ( | ) |
Create empty TimePattern.
| hueplusplus::time::TimePattern::~TimePattern | ( | ) |
Destructor for union.
|
explicit |
Create TimePattern from AbsoluteVariedTime.
|
explicit |
Create TimePattern from RecurringTime.
|
explicit |
Create TimePattern from TimeInterval.
|
explicit |
Create TimePattern from Timer.
| hueplusplus::time::TimePattern::TimePattern | ( | const TimePattern & | other | ) |
Copy constructor for union.
| AbsoluteVariedTime hueplusplus::time::TimePattern::asAbsolute | ( | ) | const |
Get contained absolute time.
| TimeInterval hueplusplus::time::TimePattern::asInterval | ( | ) | const |
Get contained time interval.
| RecurringTime hueplusplus::time::TimePattern::asRecurring | ( | ) | const |
Get contained recurring time.
| Timer hueplusplus::time::TimePattern::asTimer | ( | ) | const |
Get contained timer.
| TimePattern::Type hueplusplus::time::TimePattern::getType | ( | ) | const |
Get currently active type.
| TimePattern & hueplusplus::time::TimePattern::operator= | ( | const TimePattern & | other | ) |
Copy assignment for union.
|
static |
Parses TimePattern from formatted string as returned by Hue API.
| s | Empty string, "none", or in one of the formats the contained types return in their toString() method. |
s | HueException | when the format does not match or a parsing error occurs |
| std::invalid_argument | when an integer conversion fails |
| std::string hueplusplus::time::TimePattern::toString | ( | ) | const |
Get formatted string of the contained value as expected by Hue API.
| AbsoluteVariedTime hueplusplus::time::TimePattern::absolute |
| TimeInterval hueplusplus::time::TimePattern::interval |
| RecurringTime hueplusplus::time::TimePattern::recurring |
| Timer hueplusplus::time::TimePattern::timer |
| std::nullptr_t hueplusplus::time::TimePattern::undefined |