2 * Copyright 2008-2009, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
9 #include <device_manager.h>
18 virtual ~BaseDevice();
20 void SetID(ino_t id
) { fID
= id
; }
21 ino_t
ID() const { return fID
; }
23 virtual status_t
InitDevice();
24 virtual void UninitDevice();
26 virtual void Removed();
28 virtual bool HasSelect() const;
29 virtual bool HasDeselect() const;
30 virtual bool HasRead() const;
31 virtual bool HasWrite() const;
32 virtual bool HasIO() const;
34 virtual status_t
Open(const char* path
, int openMode
,
36 virtual status_t
Read(void* cookie
, off_t pos
, void* buffer
,
38 virtual status_t
Write(void* cookie
, off_t pos
, const void* buffer
,
40 virtual status_t
IO(void* cookie
, io_request
* request
);
41 virtual status_t
Control(void* cookie
, int32 op
, void* buffer
,
43 virtual status_t
Select(void* cookie
, uint8 event
, selectsync
* sync
);
44 virtual status_t
Deselect(void* cookie
, uint8 event
,
47 virtual status_t
Close(void* cookie
) = 0;
48 virtual status_t
Free(void* cookie
) = 0;
55 } // namespace BPrivate
58 using BPrivate::BaseDevice
;
61 #endif // BASE_DEVICE_H