00001 #ifndef FWCore_MessageService_MsgContext_h 00002 #define FWCore_MessageService_MsgContext_h 00003 00004 #include "FWCore/MessageService/interface/ELcontextSupplier.h" 00005 00006 #include <string> 00007 00008 namespace edm { 00009 namespace service { 00010 00011 class MsgContext : public ELcontextSupplier 00012 { 00013 public: 00014 MsgContext* clone() const { return new MsgContext(*this); } 00015 ELstring context() const { return context_; } 00016 ELstring summaryContext() const { return summary_context_; } 00017 ELstring fullContext() const { return context(); } 00018 00019 void setContext(const std::string& c) 00020 { 00021 context_ = c; 00022 summary_context_ = compress(c); 00023 } 00024 void clearContext() { context_.clear(); summary_context_.clear(); } 00025 00026 private: 00027 std::string context_; 00028 std::string summary_context_; 00029 std::string compress (const std::string& c) const; 00030 }; 00031 00032 } // end of namespace service 00033 } // end of namespace edm 00034 00035 #endif // FWCore_MessageService_MsgContext_h