PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/inc/vgs/project/error.h

https://bitbucket.org/sr1919/ex2vgs
C Header | 102 lines | 68 code | 17 blank | 17 comment | 0 complexity | 89d849a76bb22a279ba657e34a14cebb MD5 | raw file
  1. /*
  2. * error.h --
  3. *
  4. * Copyright (C) 1997-2010 by Volume Graphics GmbH. All Rights Reserved.
  5. *
  6. * This is unpublished proprietary source code of Volume Graphics
  7. * GmbH. The contents of this file may not be disclosed to third
  8. * parties, copied or duplicated in any form, in whole or in part,
  9. * without the prior written permission of Volume Graphics GmbH.
  10. * For further regulations see the file "license.rtf".
  11. *
  12. * Creator: Jens Frederich <frederich@volumegraphics.com>
  13. *
  14. * @(#) $Id: error.h 39119 2010-03-01 09:58:19Z frederich $
  15. */
  16. #ifndef _VGS_PROJECT_ERROR_H_
  17. #define _VGS_PROJECT_ERROR_H_
  18. // stdc++
  19. #include <string>
  20. // Component
  21. #include <vgs/project/common.h>
  22. namespace VGS { namespace Project
  23. {
  24. class VGS_PROJECT_EXPORT Error
  25. {
  26. public:
  27. enum ErrorCode
  28. {
  29. NoError = __ERROR_FIRST_ENUM,
  30. GenericError,
  31. OutOfMemory,
  32. InvalidArgument,
  33. InvalidEnum,
  34. FileNotFound,
  35. PermissionDenied,
  36. UnableToCreateFolder,
  37. UnableToDeleteFolder,
  38. UnableToFindProjectConverter,
  39. UnableToSaveProject,
  40. UnableToLoadProject,
  41. InvalidResolution,
  42. InvalidVoxelSkip,
  43. InvalidFileFormat,
  44. InvalidFileName,
  45. InvalidSize,
  46. InvalidDataType,
  47. InvalidFileCount,
  48. InvalidPositions,
  49. GenericRemoteControlError,
  50. InvalidRemoteHandle,
  51. RemoteControlServiceIsNotAvailable,
  52. MaximumNumberOfApplicationInstancesIsReached,
  53. UnableToCreateApplication,
  54. UnableToTerminateApplication,
  55. ApplicationIsBusy,
  56. NoTaskToAbort,
  57. GenericLicenseError,
  58. ApplicationIsUnexpectedlyClosed,
  59. ApplicationHasNoMacroSupport
  60. };
  61. public:
  62. static bool emitError (ErrorCode e);
  63. static ErrorCode getLastError ();
  64. static bool resetLastError ();
  65. static std::string getErrorDescription (ErrorCode e);
  66. public:
  67. class Callback
  68. {
  69. public:
  70. virtual ~Callback () {}
  71. public:
  72. virtual bool callback (const ErrorCode& message) = 0;
  73. };
  74. static bool setErrorCallback (Error::Callback* callback);
  75. static Error::Callback* getErrorCallback ();
  76. private:
  77. Error ();
  78. Error (const Error&);
  79. Error& operator = (const Error&);
  80. ~Error ();
  81. private:
  82. VGL_PRIVATE_DATA;
  83. };
  84. } } // VGS::Project
  85. #endif // _VGS_PROJECT_ERROR_H_