class LogId {
public:
LogId(string id)
: id_ (id) { }
~LogId() { }
string getId(){ return id_; }
private:
string id_;
};
static boost::thread_specific_ptr<LogId> ptrId_;
inline void SetTrLogId(const string& id) {
if (ptrId_.get() == NULL) {
ptrId_.reset( new LogId(id) );
}
}
inline string getTrLogId(){
if (ptrId_.get() == NULL) {
return string("");
}
return ptrId_.get()->getId();
}