home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classes.lha / Classes / Exec / Devices.h next >
Encoding:
C/C++ Source or Header  |  1995-01-31  |  1.9 KB  |  76 lines

  1. #ifndef CPP_EXEC_DEVICES_H
  2. #define CPP_EXEC_DEVICES_H
  3.  
  4. // Device Klassen
  5. //
  6. // Diese Klassen erlauben den Zugriff auf die Exec-Devices, an jedes einmal
  7. // geöffnete Gerät können mehrere Requests geschickt werden.
  8. //
  9. // Autor: Jochen Becher
  10. //
  11. // Historie:
  12. // Version 1.0 am 25. Juni 94
  13.  
  14. #ifndef EXEC_DEVICES_H
  15. #include <exec/devices.h>
  16. #endif
  17.  
  18. #ifndef EXEC_IO_H
  19. #include <exec/io.h>
  20. #endif
  21.  
  22. #ifndef EXEC_ERRORS_H
  23. #include <exec/errors.h>
  24. #endif
  25.  
  26. #ifndef CPP_EXEC_PORTS_H
  27. #include <classes/exec/ports.h>
  28. #endif
  29.  
  30. #ifndef CPP_EXEC_SHARE_H
  31. #include <classes/exec/share.h>
  32. #endif
  33.  
  34. class IORequestC : public PortC {
  35. public:
  36.     IORequestC(ULONG size = sizeof(struct IORequest)) throw (PortX, MemoryX);
  37.     IORequestC(const IORequestC &) throw (MemoryX);
  38.     ~IORequestC();
  39.     IORequestC &operator= (const IORequestC &) throw (MemoryX);
  40.     struct IORequest *request() const { return iorequest; };
  41.     BYTE error() const;
  42.     BYTE open(STRPTR name, ULONG unit = 0, ULONG flags = 0);
  43.     VOID close();
  44.     BYTE doIO();
  45.     BYTE doIO(UWORD command);
  46.     VOID sendIO();
  47.     VOID sendIO(UWORD command);
  48.     BOOL checkIO();
  49.     BYTE waitIO();
  50.     VOID abortIO();
  51.     BOOL isOpen() const { return !opened.only(); };
  52.     BOOL isSend() const { return send; };
  53. private:
  54.     ULONG requestsize;
  55.     IORequest *iorequest;
  56.     BOOL copied, send, closed;
  57.     ShareManualC opened;
  58. };
  59.  
  60. class IOStdRequestC : public IORequestC {
  61. public:
  62.     IOStdRequestC(ULONG size = sizeof(struct IOStdReq)) throw (PortX, MemoryX);
  63.     IOStdRequestC(const IOStdRequestC &) throw (MemoryX);
  64.     ~IOStdRequestC();
  65.     IOStdRequestC &operator= (const IOStdRequestC &) throw (MemoryX);
  66.     struct IOStdReq *request() const
  67.         { return (struct IOStdReq *) IORequestC::request(); };
  68.     ULONG actual() const;
  69.     BYTE doIO(UWORD command, ULONG length, APTR data);
  70.     BYTE doIO(UWORD command, ULONG length, APTR data, ULONG offset);
  71.     VOID sendIO(UWORD command, ULONG length, APTR data);
  72.     VOID sendIO(UWORD command, ULONG length, APTR data, ULONG offset);
  73. };
  74.  
  75. #endif
  76.