00001 #ifndef _SCOPED_FINGERPRINT_H 00002 #define _SCOPED_FINGERPRINT_H 00003 00004 #include "mstring.h" 00005 #include "ScopedStackExecution.h" 00006 00012 namespace mace { 00013 00028 class ScopedFingerprint { 00029 private: 00030 static string fingerprint; 00031 00032 public: 00034 00037 ScopedFingerprint(const std::string& selectorId) { 00038 if (ScopedStackExecution::getStackDepth() == 0) { 00039 fingerprint = ""; 00040 } 00041 fingerprint += selectorId + "("; 00042 } 00043 ~ScopedFingerprint() { 00044 fingerprint += ")"; 00045 } 00046 00048 00051 static string getFingerprint() { 00052 return fingerprint; 00053 } 00054 }; 00055 00060 } 00061 00062 #endif //_SCOPED_FINGERPRINT_H