Pol  Revision:cb584c9
checkpnt.h
Go to the documentation of this file.
1 
6 #ifndef H_CHECKPNT
7 #define H_CHECKPNT
8 #include <string>
9 
10 namespace Pol
11 {
12 namespace Core
13 {
14 void checkpoint( const char* msg, unsigned short minlvl = 11 );
15 
17 {
18 public:
19  explicit Checkpoint( const char* file );
20  ~Checkpoint();
21  Checkpoint( const Checkpoint& ) = delete;
22  Checkpoint& operator=( const Checkpoint& ) = delete;
23 
24  void setvalue( unsigned line ) { _line = line; }
25  void clear() { _line = 0; }
26 
27 private:
28  const char* _file;
29  unsigned _line;
30 };
31 }
32 
33 #define DECLARE_CHECKPOINT Core::Checkpoint checkpoint( __FILE__ )
34 
35 #define UPDATE_CHECKPOINT() checkpoint.setvalue( __LINE__ )
36 
37 #define CLEAR_CHECKPOINT() checkpoint.clear()
38 }
39 #endif
Checkpoint & operator=(const Checkpoint &)=delete
void checkpoint(const char *msg, unsigned short minlvl)
Definition: checkpnt.cpp:17
const char * _file
Definition: checkpnt.h:28
void setvalue(unsigned line)
Definition: checkpnt.h:24
Checkpoint(const char *file)
Definition: checkpnt.cpp:26
Definition: berror.cpp:12