2 * Copyright 2009-2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2008-2009, Axel Dörfler, axeld@pinc-software.de.
4 * Distributed under the terms of the MIT License.
6 #ifndef ABSTRACT_MODULE_DEVICE_H
7 #define ABSTRACT_MODULE_DEVICE_H
10 #include "BaseDevice.h"
16 class AbstractModuleDevice
: public BaseDevice
{
18 AbstractModuleDevice();
19 virtual ~AbstractModuleDevice();
21 device_module_info
* Module() const { return fDeviceModule
; }
23 void* Data() const { return fDeviceData
; }
24 device_node
* Node() const { return fNode
; }
26 virtual bool HasSelect() const;
27 virtual bool HasDeselect() const;
28 virtual bool HasRead() const;
29 virtual bool HasWrite() const;
30 virtual bool HasIO() const;
32 virtual status_t
Open(const char* path
, int openMode
,
34 virtual status_t
Read(void* cookie
, off_t pos
, void* buffer
,
36 virtual status_t
Write(void* cookie
, off_t pos
, const void* buffer
,
38 virtual status_t
IO(void* cookie
, io_request
* request
);
39 virtual status_t
Control(void* cookie
, int32 op
, void* buffer
,
41 virtual status_t
Select(void* cookie
, uint8 event
, selectsync
* sync
);
42 virtual status_t
Deselect(void* cookie
, uint8 event
,
45 virtual status_t
Close(void* cookie
);
46 virtual status_t
Free(void* cookie
);
51 device_module_info
* fDeviceModule
;
56 } // namespace BPrivate
59 using BPrivate::AbstractModuleDevice
;
62 #endif // ABSTRACT_MODULE_DEVICE_H