Dynalib Utils
CheckForError.h
Go to the documentation of this file.
1 //
2 // Created by Ken Kopelson on 15/10/17.
3 //
4 
5 #ifndef CHECKFORERROR_H
6 #define CHECKFORERROR_H
7 
8 #include <string>
9 #include <iostream>
10 #include <stdexcept>
11 
12 using namespace std;
13 
19 public:
20  static bool isValidArg(bool expResult, const std::string &msg = "???");
21  static bool isNotNull(void* obj, const std::string &msg = "???");
22  static bool isInBounds(int index, int maxIndex, const std::string &msg = "???");
23 
24  // Exceptions
25  static bool assertValidArg(bool expResult, const std::string &msg = "???");
26  static bool assertNotNull(void* obj, const std::string &msg = "???");
27  static bool assertInBounds(int index, int maxIndex, const std::string &msg = "???");
28 };
29 
30 
31 #endif //CHECKFORERROR_H
Definition: CheckForError.h:18