2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
7 #include "IOScheduler.h"
12 #include "IOSchedulerRoster.h"
15 IOScheduler::IOScheduler(DMAResource
* resource
)
17 fDMAResource(resource
),
19 fID(IOSchedulerRoster::Default()->NextID()),
21 fIOCallbackData(NULL
),
22 fSchedulerRegistered(false)
27 IOScheduler::~IOScheduler()
29 if (fSchedulerRegistered
)
30 IOSchedulerRoster::Default()->RemoveScheduler(this);
37 IOScheduler::Init(const char* name
)
43 IOSchedulerRoster::Default()->AddScheduler(this);
44 fSchedulerRegistered
= true;
51 IOScheduler::SetCallback(IOCallback
& callback
)
53 SetCallback(&IOCallback::WrapperFunction
, &callback
);
58 IOScheduler::SetCallback(io_callback callback
, void* data
)
60 fIOCallback
= callback
;
61 fIOCallbackData
= data
;
66 IOScheduler::SetDeviceCapacity(off_t deviceCapacity
)
72 IOScheduler::MediaChanged()