Skip to content

Commit

Permalink
Add convenience function to supply a EventDataRef to Event::signal()
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeprag committed Jan 8, 2014
1 parent 89b4253 commit fbaa8cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion telldus-core/common/Event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ void EventBase::signal() {
}

void EventBase::signal(EventData *eventData) {
this->signal(EventDataRef(eventData));
}

void EventBase::signal(EventDataRef eventData) {
{
TelldusCore::MutexLocker locker(&d->mutex);
d->eventDataList.push_back(EventDataRef(eventData));
d->eventDataList.push_back(eventData);
}
sendSignal();
}
Expand Down
1 change: 1 addition & 0 deletions telldus-core/common/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace TelldusCore {
bool isSignaled();
void signal();
virtual void signal(EventData *eventData);
void signal(EventDataRef eventData);
EventDataRef takeSignal();

protected:
Expand Down

0 comments on commit fbaa8cc

Please sign in to comment.