00001
00002
00003 #ifndef _CHECK_H_
00004 #define _CHECK_H_
00005
00006 template <class TYPE, class CHECK>
00007 class Check {
00008 public:
00009 Check (TYPE * t)
00010 #ifndef NDEBUG
00011 : _object (t)
00012 #endif
00013 {
00014 t = t;
00015 #ifndef NDEBUG
00016 CHECK::precondition (_object);
00017 #endif
00018 }
00019
00020 ~Check (void) {
00021 #ifndef NDEBUG
00022 CHECK::postcondition (_object);
00023 #endif
00024 }
00025
00026 private:
00027 Check (const Check&);
00028 Check& operator=(const Check&);
00029
00030 #ifndef NDEBUG
00031 TYPE * _object;
00032 #endif
00033
00034 };
00035
00036 #endif