diff options
author | André Nusser <andre.nusser@googlemail.com> | 2020-01-12 15:41:39 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2020-02-16 19:57:13 +0100 |
commit | fb992677cf62b6aa982476538faae43e5bbbd87f (patch) | |
tree | 8973b63653e2acbecb2b273444b4dc67dc623fd8 /src/events.cc | |
parent | 8070e5578aa9d185f07534778dc0ebf596fece13 (diff) |
Introduce EventsDS to handle all the events and enable new features.
Also:
* Added an id.h class to make IDs with type
* Added a range class to easily use range based for loops
Diffstat (limited to 'src/events.cc')
-rw-r--r-- | src/events.cc | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/events.cc b/src/events.cc index 1acbc11..d8ca658 100644 --- a/src/events.cc +++ b/src/events.cc @@ -1,6 +1,6 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** - * event.cc + * events.cc * * Sat Sep 18 22:02:16 CEST 2010 * Copyright 2010 Bent Bisballe Nyeng @@ -26,26 +26,4 @@ */ #include "events.h" -void EventQueue::post(Event* event, timepos_t time) -{ - std::lock_guard<std::mutex> guard(mutex); - event->offset = time; - queue.insert(std::pair<timepos_t, Event*>(time, event)); -} - -Event* EventQueue::take(timepos_t time) -{ - std::lock_guard<std::mutex> guard(mutex); - std::multimap<timepos_t, Event*>::iterator i = queue.find(time); - if(i == queue.end()) - return NULL; - Event* event = i->second; - queue.erase(i); - return event; -} - -bool EventQueue::hasEvent(timepos_t time) -{ - std::lock_guard<std::mutex> guard(mutex); - return queue.find(time) != queue.end(); -} +// TODO: remove this file if it isn't needed anymore |