libsaria: Remove my custom List class from the idle queue
I plan on removing this class in favor STL classes. I probably shouldn't have even tried to implement this myself... Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
57bf98972d
commit
fa09d53d70
|
@ -2,7 +2,6 @@
|
|||
#define LIBSARIA_PLAYLIST_STACK_H
|
||||
|
||||
#include <playlist.h>
|
||||
#include <list.h>
|
||||
|
||||
#define MAX_PLAYLISTS 10
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) 2011 Bryan Schumaker.
|
||||
#include <deck.h>
|
||||
#include <audio.h>
|
||||
#include <print.h>
|
||||
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
// Copyright (c) 2011 Bryan Schumaker.
|
||||
#include <notify.h>
|
||||
#include <idle.h>
|
||||
#include <list.h>
|
||||
#include <print.h>
|
||||
|
||||
static libsaria::List<IdleTask *> idle_queue;
|
||||
#include <queue>
|
||||
using namespace std;
|
||||
|
||||
static deque<IdleTask *> idle_queue;
|
||||
static float queued = 0.0;
|
||||
static float serviced = 0.0;
|
||||
|
||||
|
@ -34,7 +36,8 @@ namespace libsaria
|
|||
IdleTask *task;
|
||||
if (size() == 0)
|
||||
return 0;
|
||||
task = idle_queue.pop_front();
|
||||
task = idle_queue.front();
|
||||
idle_queue.pop_front();
|
||||
do_task(task);
|
||||
if (size() == 0) {
|
||||
queued = 0.0;
|
||||
|
@ -61,10 +64,12 @@ namespace libsaria
|
|||
|
||||
void idle::cancel_all(void *data)
|
||||
{
|
||||
ListItem<IdleTask *> *it;
|
||||
for (it = idle_queue.first(); it != idle_queue.end(); it = it->next()) {
|
||||
if (it->get_value()->should_cancel(data))
|
||||
it = idle_queue.erase(it);
|
||||
deque<IdleTask *>::iterator it;
|
||||
for (it = idle_queue.begin(); it != idle_queue.end();) {
|
||||
if ((*it)->should_cancel(data))
|
||||
idle_queue.erase(it);
|
||||
else
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user