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

  1. #ifndef CPP_EXCEPTIONS_EXCEPTIONS_H
  2. #define CPP_EXCEPTIONS_EXCEPTIONS_H
  3.  
  4. // Die Ausnahmehierarchie
  5. //
  6. // "Ausnahmebehandlung ist Fehlerbehandlung" - B. Stroustrup
  7. // Die in der Klassenbibliothek verwendete Ausnahmen sind ausschließlich
  8. // zur Fehlerbehandlung eingesetzt - wobei der Begriff "Fehler" sehr eng
  9. // gesehen wird. Speicherbehandlung fällt unter diesen Begriff, der Versuch
  10. // Dateien zu öffnen allerdings nicht, hier erscheint das Fehlschlagen doch
  11. // allzu normal.
  12. //
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17.  
  18. #ifndef EXEC_MEMORY_H
  19. #include <exec/memory.h>
  20. #endif
  21.  
  22. #ifndef GRAPHICS_TEXT_H
  23. #include <graphics/text.h>
  24. #endif
  25.  
  26. #ifndef INCLUDE_EXCEPTION_H
  27. #include <exception.h>
  28. #endif
  29.  
  30. // *************************************************************
  31.  
  32. class ResourceX : public Exception {
  33. };
  34.  
  35. class MemoryX : public ResourceX {
  36. public:
  37.     MemoryX(ULONG s, ULONG f = MEMF_ANY) : mSize(s), mFlags(f) { };
  38.     ULONG size() const { return mSize; };
  39.     ULONG flags() const { return mFlags; };
  40. protected:
  41.     ULONG mSize;
  42.     ULONG mFlags;
  43. };
  44.  
  45. class SignalX : public ResourceX {
  46. public:
  47.     SignalX(LONG n = -1) : sigNum(n) { };
  48.     LONG signal() const { return sigNum; };
  49. protected:
  50.     LONG sigNum;
  51. };
  52.  
  53. class PortX : public ResourceX {
  54. public:
  55.     PortX(BOOL pub = FALSE) : pPublic(pub) { };
  56.     BOOL isPublic() const { return pPublic; };
  57. protected:
  58.     BOOL pPublic;
  59. };
  60.  
  61. class DosObjectX : public ResourceX {
  62. public:
  63.     DosObjectX(ULONG type = ~0) : dType(type) { };
  64.     ULONG type() const { return dType; };
  65. protected:
  66.     ULONG dType;
  67. };
  68.  
  69. class RDArgsX : public ResourceX {
  70. };
  71.  
  72. class BoopsiX : public ResourceX {
  73. };
  74.  
  75. class BoopsiClassX : public ResourceX {
  76. };
  77.  
  78. class LayerX : public ResourceX {
  79. };
  80.  
  81. // *************************************************************
  82.  
  83. class IntuitionX : public Exception {
  84. };
  85.  
  86. class FontX : public IntuitionX {
  87. };
  88.  
  89. class ScreenX : public IntuitionX {
  90. };
  91.  
  92. class ScreenDrawInfoX : public IntuitionX {
  93. };
  94.  
  95. class WindowX : public IntuitionX {
  96. };
  97.  
  98. class VisualInfoX : public IntuitionX {
  99. };
  100.  
  101. class AslRequestX : public IntuitionX {
  102. public:
  103.     AslRequestX(ULONG type) : asltype(type) { };
  104.     ULONG type() const { return asltype; };
  105. private:
  106.     ULONG asltype;
  107. };
  108.  
  109. // *************************************************************
  110.  
  111. class LayouterX : public Exception {
  112. };
  113.  
  114. // *************************************************************
  115.  
  116. #endif
  117.