1 #ifndef STATUSPROVIDER_H 2 #define STATUSPROVIDER_H 19 bool hasNotifications()
const;
20 bool hasCriticalNotifications()
const;
22 const std::string ¤tStatus()
const;
23 double currentPercentage()
const;
24 size_t registerCallback(CallbackFunction callback);
25 void unregisterCallback(
size_t id);
26 void unregisterAllCallbacks();
30 bool isAborted()
const;
31 void invalidateStatus();
32 void invalidateNotifications();
33 void updateStatus(
const std::string &status);
34 void updateStatus(
const std::string &status,
double percentage);
35 void updatePercentage(
double percentage);
37 void addNotification(
NotificationType type,
const std::string &message,
const std::string &context);
39 void addNotifications(
const std::string &higherContext,
const StatusProvider &from);
46 inline void invokeCallbacks();
53 CallbackVector m_callbacks;
75 m_percentage = percentage;
86 m_percentage = percentage;
105 return m_notifications;
113 return !m_notifications.empty();
129 return m_worstNotificationType;
137 if(m_status.empty() && m_forward) {
138 return m_forward->currentStatus();
148 if(m_percentage == 0.0 && m_forward) {
149 return m_forward->currentPercentage();
162 return m_abort || (m_forward && m_forward->isAborted());
173 if(
id < m_callbacks.size()) {
174 m_callbacks[id] =
nullptr;
248 m_notifications.clear();
255 inline void StatusProvider::invokeCallbacks()
257 for(std::function<
void (
StatusProvider &sender)> &callback : usedProvider()->m_callbacks) {
267 inline void StatusProvider::updateWorstNotificationType(
NotificationType notificationType)
269 if(static_cast<int>(m_worstNotificationType) < static_cast<int>(notificationType)) {
270 m_worstNotificationType = notificationType;
277 #endif // STATUSPROVIDER_H
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.