00001 #ifndef ATLFAST_CHECKNULL_H 00002 #define ATLFAST_CHECKNUL_H 00005 #ifndef STD_ASSERT_H 00006 #include <assert.h> 00007 #define STD_ASSERT_H 00008 #endif 00009 00010 namespace Atlfast{ 00011 class CheckNull{ 00012 public: 00013 CheckNull():m_count(0), m_noNull(true){} 00014 template<class T> 00015 void operator()(T* t){ 00016 if(t == 0) { 00017 m_noNull = false; 00018 } 00019 ++m_count; 00020 } 00021 bool noNull(){return m_noNull;} 00022 private: 00023 int m_count; 00024 bool m_noNull; 00025 00026 }; 00027 } 00028 #endif