home *** CD-ROM | disk | FTP | other *** search
- #ifndef CPP_EXEC_DEVICES_H
- #define CPP_EXEC_DEVICES_H
-
- // Device Klassen
- //
- // Diese Klassen erlauben den Zugriff auf die Exec-Devices, an jedes einmal
- // geöffnete Gerät können mehrere Requests geschickt werden.
- //
- // Autor: Jochen Becher
- //
- // Historie:
- // Version 1.0 am 25. Juni 94
-
- #ifndef EXEC_DEVICES_H
- #include <exec/devices.h>
- #endif
-
- #ifndef EXEC_IO_H
- #include <exec/io.h>
- #endif
-
- #ifndef EXEC_ERRORS_H
- #include <exec/errors.h>
- #endif
-
- #ifndef CPP_EXEC_PORTS_H
- #include <classes/exec/ports.h>
- #endif
-
- #ifndef CPP_EXEC_SHARE_H
- #include <classes/exec/share.h>
- #endif
-
- class IORequestC : public PortC {
- public:
- IORequestC(ULONG size = sizeof(struct IORequest)) throw (PortX, MemoryX);
- IORequestC(const IORequestC &) throw (MemoryX);
- ~IORequestC();
- IORequestC &operator= (const IORequestC &) throw (MemoryX);
- struct IORequest *request() const { return iorequest; };
- BYTE error() const;
- BYTE open(STRPTR name, ULONG unit = 0, ULONG flags = 0);
- VOID close();
- BYTE doIO();
- BYTE doIO(UWORD command);
- VOID sendIO();
- VOID sendIO(UWORD command);
- BOOL checkIO();
- BYTE waitIO();
- VOID abortIO();
- BOOL isOpen() const { return !opened.only(); };
- BOOL isSend() const { return send; };
- private:
- ULONG requestsize;
- IORequest *iorequest;
- BOOL copied, send, closed;
- ShareManualC opened;
- };
-
- class IOStdRequestC : public IORequestC {
- public:
- IOStdRequestC(ULONG size = sizeof(struct IOStdReq)) throw (PortX, MemoryX);
- IOStdRequestC(const IOStdRequestC &) throw (MemoryX);
- ~IOStdRequestC();
- IOStdRequestC &operator= (const IOStdRequestC &) throw (MemoryX);
- struct IOStdReq *request() const
- { return (struct IOStdReq *) IORequestC::request(); };
- ULONG actual() const;
- BYTE doIO(UWORD command, ULONG length, APTR data);
- BYTE doIO(UWORD command, ULONG length, APTR data, ULONG offset);
- VOID sendIO(UWORD command, ULONG length, APTR data);
- VOID sendIO(UWORD command, ULONG length, APTR data, ULONG offset);
- };
-
- #endif
-