Class CpCalendarPoller
Defined in File cp_calendar_poller.hpp
Inheritance Relationships
Base Types
public smacc2::ISmaccComponentpublic smacc2::ISmaccUpdatable
Class Documentation
-
class CpCalendarPoller : public smacc2::ISmaccComponent, public smacc2::ISmaccUpdatable
Component that polls Google Calendar and parses event data.
This component periodically fetches the agenda from Google Calendar using gcalcli’s TSV output format and parses it into CalendarEvent structures.
TSV Format: Start_Date | Start_Time | End_Date | End_Time | Title | Location | Description | Calendar
Public Functions
-
CpCalendarPoller()
-
virtual ~CpCalendarPoller() = default
-
void onInitialize() override
-
bool refreshAgenda()
Force an immediate agenda refresh.
- Returns:
true if refresh was successful
-
std::vector<CalendarEvent> getEvents() const
Get cached list of calendar events.
-
std::vector<CalendarEvent> findEvents(const std::string &pattern, bool use_regex = false) const
Get events matching a title pattern.
- Parameters:
pattern – Pattern to match (regex or exact based on use_regex)
use_regex – If true, use regex matching
-
std::vector<CalendarEvent> getEventsInWindow(std::chrono::system_clock::time_point start, std::chrono::system_clock::time_point end) const
Get events happening within a time window.
-
std::vector<CalendarEvent> getActiveEvents() const
Get currently active events.
-
std::chrono::system_clock::time_point getLastPollTime() const
Get the time of the last successful poll.
-
template<typename T>
inline smacc2::SmaccSignalConnection onAgendaUpdated(void (T::* callback)(const std::vector<CalendarEvent>&), T *object)
-
template<typename TOrthogonal, typename TSourceObject>
inline void onStateOrthogonalAllocation() Template method for type-safe event posting setup.
Public Members
-
smacc2::SmaccSignal<void(const std::vector<CalendarEvent>&)> onAgendaUpdated_
-
std::function<void(const std::vector<CalendarEvent>&)> postAgendaUpdatedEvent_
Protected Functions
-
void update() override
Periodic update for polling (called by SignalDetector)
-
CpCalendarPoller()