PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/native/FlyCapture2/include/Error.h

https://github.com/yoursoultree/FlyCapture2ANE
C Header | 148 lines | 35 code | 24 blank | 89 comment | 0 complexity | 117486256abc66834d3873d780a998b4 MD5 | raw file
  1. //=============================================================================
  2. // Copyright Š 2008 Point Grey Research, Inc. All Rights Reserved.
  3. //
  4. // This software is the confidential and proprietary information of Point
  5. // Grey Research, Inc. ("Confidential Information"). You shall not
  6. // disclose such Confidential Information and shall use it only in
  7. // accordance with the terms of the license agreement you entered into
  8. // with Point Grey Research, Inc. (PGR).
  9. //
  10. // PGR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  11. // SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
  12. // IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  13. // PURPOSE, OR NON-INFRINGEMENT. PGR SHALL NOT BE LIABLE FOR ANY DAMAGES
  14. // SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  15. // THIS SOFTWARE OR ITS DERIVATIVES.
  16. //=============================================================================
  17. //=============================================================================
  18. // $Id: Error.h 112716 2011-05-13 16:37:36Z soowei $
  19. //=============================================================================
  20. #ifndef PGR_FC2_ERROR_H
  21. #define PGR_FC2_ERROR_H
  22. #include "FlyCapture2Platform.h"
  23. #include "FlyCapture2Defs.h"
  24. #include <stdio.h>
  25. namespace FlyCapture2
  26. {
  27. struct ErrorImpl;
  28. /**
  29. * The Error object represents an error that is returned from the library.
  30. * Overloaded operators allow comparisons against other Error objects or
  31. * the ErrorType enumeration.
  32. */
  33. class FLYCAPTURE2_API Error
  34. {
  35. public:
  36. /**
  37. * Default constructor.
  38. */
  39. Error();
  40. /**
  41. * Copy constructor.
  42. */
  43. Error( const Error& error );
  44. /**
  45. * Default destructor.
  46. */
  47. virtual ~Error();
  48. /**
  49. * Assignment operator.
  50. */
  51. virtual Error& operator=( const Error& error );
  52. /**
  53. * Equality operator.
  54. */
  55. virtual bool operator==( const Error& error ) const;
  56. /**
  57. * Equality operator. This overloaded operator compares the
  58. * ErrorType of the Error against the specified ErrorType.
  59. */
  60. virtual bool operator==( const ErrorType& errorType ) const;
  61. /**
  62. * Inequality operator.
  63. */
  64. virtual bool operator!=( const Error& error ) const;
  65. /**
  66. * Inequality operator. This overloaded operator compares the
  67. * ErrorType of the Error against the specified ErrorType.
  68. */
  69. virtual bool operator!=( const ErrorType& errorType ) const;
  70. /**
  71. * Retrieve the ErrorType of the error.
  72. *
  73. * @return The ErrorType of the error.
  74. */
  75. virtual ErrorType GetType() const;
  76. /**
  77. * Retrieve the top level description of the error that occurred.
  78. *
  79. * @return A string with the error description.
  80. */
  81. virtual const char* GetDescription() const;
  82. /**
  83. * Retrieve the line number where the error originated.
  84. *
  85. * @return The line number.
  86. */
  87. virtual unsigned int GetLine() const;
  88. /**
  89. * Retrieve the source filename where the error originated.
  90. *
  91. * @return A string with the file name.
  92. */
  93. virtual const char* GetFilename() const;
  94. /**
  95. * Get the error which caused this error.
  96. *
  97. * @return An error object representing the cause of this error.
  98. */
  99. virtual Error GetCause() const;
  100. /**
  101. * Retrieve the build date of the file where the error originated.
  102. *
  103. * @return A string with the build date and time.
  104. */
  105. virtual const char* GetBuildDate() const;
  106. /**
  107. * Retrieve the support information.
  108. * It is not implemented in this release.
  109. *
  110. * @return A string containing support information.
  111. */
  112. virtual const char* CollectSupportInformation() const;
  113. /**
  114. * Print a formatted log trace to stderr.
  115. */
  116. virtual void PrintErrorTrace() const;
  117. protected:
  118. private:
  119. ErrorType m_type;
  120. ErrorImpl* m_pImpl;
  121. friend class InternalError;
  122. };
  123. }
  124. #endif // PGR_FC2_ERROR_H