Buffer Interface
BFException.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <BFType.h>
4 
5 #include <string>
6 
11 class BFDLL BFExceptionBase
12 {
13 public:
14  // Non-error constructor.
15  BFExceptionBase (void);
16 
17  // Copy constructors.
18  BFExceptionBase (BFExceptionBase const& to_copy);
19  BFExceptionBase (BFExceptionBase &&to_take);
20 
21  // Destructor.
22  virtual ~BFExceptionBase (void);
23 
24  // Copy operator.
25  BFExceptionBase& operator= (BFExceptionBase const& to_copy);
26  BFExceptionBase& operator= (BFExceptionBase &&to_take);
27 
28  // Returns an text based message of an error that has occured. The default implementation
29  // invokes the std::string getErrorText method, internally, but will not throw an exception.
30  virtual BFU32 getErrorText (PBFCHAR ErrorText, PBFU32 ErrorTextSize) const;
31 
32  // Return the error text as a std::string. Throws a BFException on any error.
33  virtual std::string getErrorText (void) const;
34 
35  // Returns the error number of the error that occured.
36  virtual BFU32 getErrorNumber (void) const;
37 
38  // Display a dialog box for this exception.
39  virtual BFU32 showErrorMsg (void) const;
40 
41 protected:
42  // Error constructor.
43  BFExceptionBase (const BFU32 number, std::string const& message);
44  BFExceptionBase (const BFU32 number, std::string &&message);
45 
46 private:
47  struct PrivateData;
48  PrivateData *m_pd;
49 };
50 
56 
66 class BFDLL BFCiException : public BFExceptionBase
67 {
68 public:
69  // Throw a BFCiException for the error if the error isn't BF_OK.
70  static void check (Bd hBoard, const BFU32 error);
71 
72  // Return the Bi error message for given board and code.
73  static std::string getErrorText (Bd hBoard, const BFU32 error);
74 
75  // Non-error constructor.
76  BFCiException (void);
77 
78  // Error constructors.
79  BFCiException (Bd hBoard, const BFU32 error);
80 
81  // Copy constructors.
82  BFCiException (BFCiException const& to_copy);
83  BFCiException (BFCiException &&to_take);
84 
85  // Copy operator.
86  BFCiException& operator= (BFCiException const& to_copy);
88 };
89 
99 class BFDLL BiException : public BFExceptionBase
100 {
101 public:
102  // Throw a BFException for the error if the error isn't BF_OK.
103  static void check (Bd hBoard, const BFU32 error);
104 
105  // Return the BF/Ci error message for given board and code.
106  static std::string getErrorText (Bd hBoard, const BFU32 error);
107 
108  // Non-error constructor.
109  BiException (void);
110 
111  // Error constructors.
112  BiException (Bd hBoard, const BFU32 error);
113 
114  // Copy constructors.
115  BiException (BiException const& to_copy);
116  BiException (BiException &&to_take);
117 
118  // Copy operator.
119  BiException& operator= (BiException const& to_copy);
120  BiException& operator= (BiException &&to_take);
121 
122  // Display a dialog box for this exception.
123  virtual BFU32 showErrorMsg (void) const;
124 };
Exception thrown when a BitFlow SDK error occurs.
Definition: BFException.hpp:66
unsigned long BFU32
Definition: BFTypeNT.h:55
Base class of all BitFlow exception classes.
Definition: BFException.hpp:11
virtual std::string getErrorText(void) const
Definition: BFException.cpp:164
unsigned long * PBFU32
Definition: BFTypeNT.h:55
Exception thrown when a BitFlow SDK error occurs.
Definition: BFException.hpp:99
void *** Bd
Definition: BFType.h:88
BFExceptionBase BFException
typedef of BFExceptionBase.
Definition: BFException.hpp:55
virtual BFU32 showErrorMsg(void) const
Definition: BFException.cpp:185
char * PBFCHAR
Definition: BFTypeNT.h:33
BFExceptionBase & operator=(BFExceptionBase const &to_copy)
Definition: BFException.cpp:95