Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

etools.h

Go to the documentation of this file.
00001 // ETOOLS.H
00002 //
00003 // (c) 2000-2001 Alfred E. Heggestad
00004 //
00005 //    This program is free software; you can redistribute it and/or modify
00006 //    it under the terms of the GNU General Public License version 2 as
00007 //    published by the Free Software Foundation.
00008 //
00009 
00010 #if !defined(__ETOOLS_H__)
00011 #define __ETOOLS_H__
00012 
00013 #include <e32std.h>
00014 #include <e32svr.h>
00015 
00016 //
00017 // put this in your constructor/desctructor to see the memory usage
00018 //
00019 
00020 //
00021 // Use this macro in the beginning of functions to check that some ptrs are != NULL
00022 //
00023 
00024 #ifndef __PANIC
00025 #ifdef _UNICODE
00026 #define __PANIC(p) { char tmp[] = __FILE__; \
00027         TInt i;\
00028                 for(i=sizeof(tmp)-1;i>=0;i--) \
00029                         if( (tmp[i] == 0x5c /* '\' */) || (tmp[i] == '/') ) \
00030                                 break; \
00031                 TBuf8<32> txt8((const TUint8*)&tmp[++i]); \
00032                 TBuf16<32> txt16; \
00033                 txt16.Copy(txt8); \
00034                 User::Panic( txt16 , __LINE__ ); }
00035 #else
00036 #define __PANIC(p)      { \
00037                                         RDebug::Print(_L("WARNING!!! pointer to '%s' was NULL"), #p ); \
00038                                         RDebug::Print(_L("WARNING!!! file %s line %d"), __FILE__, __LINE__ ); \
00039                                         User::Panic( _L(__FILE__) , __LINE__ ); \
00040                                         }
00041 
00042 #endif  // _UNICODE
00043 
00044 #endif  // __PANIC
00045 
00046 
00047 //
00048 //      Check var against mask, return bool type
00049 //
00050 #define BOOL_BIT(var,msk) ( (var & msk)==(msk) )
00051 //#define BOOL_BIT(var,msk)     (var & msk)
00052 #pragma warning( disable : 4800 )  // Disable warning messages
00053 
00054 
00055 //
00056 // Profiling - log ticks
00057 //
00058 #if _DEBUG
00059 #define DUMP_TICK(a) RDebug::Print(_L("tick %d: %d"), a, User::TickCount() );
00060 #else
00061 #define DUMP_TICK(a)
00062 #endif
00063 
00064 
00065 #endif // ETOOLS_H

Generated on Tue Feb 8 04:07:54 2005 for E32frodo by doxygen 1.3.3