LayoutExceptionEnum.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #ifndef LAYOUTEXCEPTIONENUM_H
  2. #define LAYOUTEXCEPTIONENUM_H
  3. #include <GraphLayoutLibrary_global.h>
  4. #include <LayoutException/LayoutExceptionConstants.h>
  5. #include <QString>
  6. /**
  7. * @brief The LayoutExceptionEnum class
  8. *
  9. * The class defines layout exception enums.
  10. */
  11. class GRAPHLAYOUTLIBRARYSHARED_EXPORT LayoutExceptionEnum
  12. {
  13. public:
  14. /** @name Creators
  15. * The methods under this section are responsible for constructing or
  16. * destructing an instance of type LayoutExceptionEnum.
  17. */
  18. //@{
  19. /**
  20. Constructs new object of type LayoutExceptionEnum.
  21. @pre none
  22. @param none
  23. @return none
  24. @throw none
  25. */
  26. LayoutExceptionEnum();
  27. //@}
  28. /**
  29. * Enum for types of layout related exceptions.
  30. */
  31. enum LayoutExceptionTypes
  32. {
  33. LAYOUTEXCEPTION = EXCEPTION_ERROR_CODE_START,
  34. LAYOUT_FILEIOEXCEPTION = LAYOUTEXCEPTION + EXCEPTION_ERROR_CODE_START_OFFSET,
  35. LAYOUT_MEMORYEXCEPTION = LAYOUT_FILEIOEXCEPTION + EXCEPTION_ERROR_CODE_START_OFFSET,
  36. LAYOUT_BOOSTEXCEPTION = LAYOUT_MEMORYEXCEPTION + EXCEPTION_ERROR_CODE_START_OFFSET
  37. };
  38. /**
  39. * Enum for subtypes of layout related exceptions.
  40. */
  41. enum LayoutExceptionSubTypes
  42. {
  43. INVALID_PARAMETER = LAYOUTEXCEPTION,
  44. DUPLICATE_ID = LAYOUTEXCEPTION + 1,
  45. INVALID_ATTRIBUTE_VALUE = LAYOUTEXCEPTION + 2,
  46. MANDATORY_FIELD_MISSING = LAYOUTEXCEPTION + 3,
  47. EMPTY_CONTAINER = LAYOUTEXCEPTION + 4,
  48. INVALID_TYPE = LAYOUTEXCEPTION + 5,
  49. REQUIRED_PARAMETER_NOT_SET = LAYOUTEXCEPTION + 6,
  50. GRAPH_CONTAINS_CYCLE = LAYOUTEXCEPTION + 7,
  51. NOT_FOUND_IN_CONTAINER = LAYOUTEXCEPTION + 8,
  52. INCONSISTENT_DATASTRUCTURE = LAYOUTEXCEPTION + 9,
  53. INVALID_OPERATION = LAYOUTEXCEPTION + 10,
  54. INVALID_GRAPH_TYPE = LAYOUTEXCEPTION + 11,
  55. UNKNOWNLAYOUTEXCEPTION = LAYOUTEXCEPTION + EXCEPTION_ERROR_CODE_END_OFFSET
  56. };
  57. /**
  58. * Enum for subtypes of file IO related exceptions.
  59. */
  60. enum FileIOExceptionSubTypes
  61. {
  62. FILE_NOT_FOUND = LAYOUT_FILEIOEXCEPTION,
  63. INVALID_FILE_NAME = LAYOUT_FILEIOEXCEPTION + 1,
  64. UNSUPPORTED_FILE_TYPE = LAYOUT_FILEIOEXCEPTION + 2,
  65. UNSUPPORTED_FILE_FORMAT = LAYOUT_FILEIOEXCEPTION + 3,
  66. FILE_READ_OPERATION_ERROR = LAYOUT_FILEIOEXCEPTION + 4,
  67. DIRECTORY_NOT_FOUND = LAYOUT_FILEIOEXCEPTION + 5,
  68. LAYOUT_INVALID_FILE_FORMAT = LAYOUT_FILEIOEXCEPTION + 6,
  69. INVALID_FILE_OPERATION = LAYOUT_FILEIOEXCEPTION + 7,
  70. UNKNOWNFILEIOEXCEPTION = LAYOUT_FILEIOEXCEPTION + EXCEPTION_ERROR_CODE_END_OFFSET
  71. };
  72. /**
  73. * Enum for subtypes of memory related exceptions.
  74. */
  75. enum MemoryExceptionSubTypes
  76. {
  77. NULL_POINTER_EXCEPTION = LAYOUT_MEMORYEXCEPTION,
  78. UNKNOWNMEMORYEXCEPTION = LAYOUT_MEMORYEXCEPTION + EXCEPTION_ERROR_CODE_END_OFFSET
  79. };
  80. /** @name Queries
  81. * The methods under this section are responsible for accessing
  82. * an instance of type GraphCycleHandler.
  83. */
  84. //@{
  85. /** static member function to convert layout exception enum to string
  86. @pre
  87. @param enExceptionTypes
  88. Enum of type LayoutExceptionTypes
  89. @return QString
  90. @throw boost graph exception
  91. */
  92. static QString getStringForEnum(LayoutExceptionEnum::LayoutExceptionTypes enExceptionTypes);
  93. //@}
  94. };
  95. #endif // LAYOUTEXCEPTIONENUM_H