LayoutMemoryException.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #ifndef LAYOUTMEMORYEXCEPTION_H
  2. #define LAYOUTMEMORYEXCEPTION_H
  3. #include <GraphLayoutLibrary_global.h>
  4. #include <LayoutException/LayoutException.h>
  5. #include <LayoutException/LayoutExceptionConstants.h>
  6. #include <QString>
  7. /**
  8. * @brief The LayoutMemoryException class
  9. *
  10. * The class defines layout memory exception enums. Inherites LayoutException.
  11. */
  12. class GRAPHLAYOUTLIBRARYSHARED_EXPORT LayoutMemoryException : public LayoutException
  13. {
  14. private:
  15. QString m_sObjectName; /*!< Name of object that triggered exception */
  16. LayoutExceptionEnum::MemoryExceptionSubTypes m_enExceptionSubType; /*!< Memory exception subtype */
  17. // Private Helper Functions
  18. /** @name Helper
  19. * The methods under this section are helper functions of MemoryException.
  20. */
  21. //@{
  22. /**
  23. Constructs the error message string for the specified exception sub type.
  24. @pre none
  25. @param none
  26. @return string containing error message specific to the exception subtype.
  27. @throw none
  28. */
  29. QString constructMessageForExceptionSubType();
  30. //@}
  31. public:
  32. //Creator
  33. /** @name Creators
  34. * The methods under this section are responsible for constructing or
  35. * destructing an instance of type MemoryException.
  36. */
  37. //@{
  38. /**
  39. Constructs new object of MemoryException using specified parameters.
  40. @pre none
  41. @param sFunctionName
  42. name of the function at which the exception has occurred.
  43. @param enExceptionSubType
  44. valid value of MemoryExceptionSubTypes enum.
  45. @param sObjectName
  46. name of the object for which the MemoryException is thrown.
  47. @throw none
  48. */
  49. LayoutMemoryException(QString sFunctionName, LayoutExceptionEnum::MemoryExceptionSubTypes enExceptionSubType,
  50. QString sObjectName);
  51. /**
  52. Constructs new object of MemoryException.
  53. */
  54. LayoutMemoryException();
  55. /**
  56. destroy object of typr memoryexception
  57. */
  58. ~LayoutMemoryException() throw();
  59. //@}
  60. //Queries
  61. /** @name Queries
  62. * The methods under this section are responsible for querying
  63. * an instance of type MemoryException.
  64. */
  65. //@{
  66. /**
  67. Gets the object name for which exception is occurred.
  68. @pre none
  69. @param none
  70. @return string containing object name.
  71. @throw none
  72. */
  73. QString getObjectName();
  74. /**
  75. This function returns the error code associated with the exception.
  76. @pre none
  77. @param none
  78. @return the error code associated with the exception.
  79. @throw none
  80. */
  81. int getErrorCode();
  82. /**
  83. This function returns the eception subtype associated with the exception.
  84. @pre none
  85. @param none
  86. @return the exception subtype associated with the exception.
  87. @throw none
  88. */
  89. LayoutExceptionEnum::MemoryExceptionSubTypes getExceptionSubType();
  90. //@}
  91. };
  92. #endif // LAYOUTMEMORYEXCEPTION_H