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

prefix.h

00001 // -*- mode: c++;
00002 #ifndef prefix_h
00003 #define prefix_h
00004 
00005 #include <sstream>
00006 
00007 namespace streamlog{
00008 
00009   class logscope ;
00010   class logstream ;
00011 
00012 
00019   class prefix_base{
00020   
00021     friend class logscope ;
00022     friend class logstream ;
00023 
00024   protected:
00025     std::string _name ;
00026     std::string _levelName ;
00027   
00028   public:
00029     prefix_base() ;
00030     virtual ~prefix_base() ;
00031  
00032     virtual std::string operator()() =0 ;
00033     
00034     void setLevelName( const std::string& lName) { _levelName = lName ; } 
00035   
00036   };
00037 
00044   class prefix : public prefix_base{
00045   public:
00046     virtual std::string operator()()  {
00047       std::stringstream ss ;
00048       ss << "[ " << this->_levelName << " \"" << this->_name << "\"] " ;
00049       return ss.str() ;
00050     }
00051 
00052   };
00053 
00054 
00055 
00056 }
00057 #endif

Generated on Mon Jan 12 09:48:51 2009 for Marlin by doxygen 1.3.5