Atlfast::HeaderPrinter Class Reference

#include <HeaderPrinter.h>

List of all members.

Public Member Functions

 HeaderPrinter (string title, MsgStream &log)
void add (const string &, std::vector< int >::const_iterator be, std::vector< int >::const_iterator en)
void add (const string &, int)
void add (const string &, double)
void add (const string &, const string &t)
void add (const string &, bool)
void add (const string &)
void print () const

Static Public Attributes

static unsigned int width
static string m_fullLine

Private Attributes

string m_title
MsgStream & m_log
std::vector< string > m_strings
string m_hollowLine


Detailed Description

Print maker headers to log file

Definition at line 33 of file HeaderPrinter.h.


Constructor & Destructor Documentation

Atlfast::HeaderPrinter::HeaderPrinter ( string  title,
MsgStream &  log 
)

Definition at line 15 of file HeaderPrinter.cxx.

00015                                                           : 
00016     m_title(title), m_log(log){
00017 
00018     //    const unsigned int width = 80;
00019     //    string fullLine(width, '=');
00020     m_hollowLine+=string(1u,'|');
00021     m_hollowLine+=string(width-2,' ');
00022     m_hollowLine+=string(1u,'|');
00023     int nBlanks =width-m_title.size()-2;
00024     if(nBlanks>0){
00025       unsigned int lBlanks = (nBlanks%2==0)? nBlanks/2:1+nBlanks/2;
00026       unsigned int rBlanks = nBlanks/2;
00027       m_title=
00028         string(1u,'|')
00029         +string(lBlanks,' ')
00030         +m_title
00031         +string(rBlanks,' ')
00032         +string(1u,'|');
00033     }
00034   }


Member Function Documentation

void Atlfast::HeaderPrinter::add ( const string &  ,
std::vector< int >::const_iterator  be,
std::vector< int >::const_iterator  en 
)

Definition at line 36 of file HeaderPrinter.cxx.

00038                                                           {
00039     ostringstream sout;
00040     sout<<s;
00041     for(; it !=en; ++it) sout << " " << (*it);
00042     m_strings.push_back(sout.str());
00043   }

void Atlfast::HeaderPrinter::add ( const string &  ,
int   
)

Definition at line 45 of file HeaderPrinter.cxx.

00045                                                {
00046     ostringstream sout;
00047     sout << s << " " << i;
00048     m_strings.push_back(sout.str());
00049   }

void Atlfast::HeaderPrinter::add ( const string &  ,
double   
)

Definition at line 51 of file HeaderPrinter.cxx.

00051                                                   {
00052     ostringstream sout;
00053     sout << s << " " << d;
00054     m_strings.push_back(sout.str());
00055   }

void Atlfast::HeaderPrinter::add ( const string &  ,
const string &  t 
)

Definition at line 57 of file HeaderPrinter.cxx.

00057                                                            {
00058     string temp = s1+" "+s2;
00059     m_strings.push_back(temp);
00060   }

void Atlfast::HeaderPrinter::add ( const string &  ,
bool   
)

Definition at line 62 of file HeaderPrinter.cxx.

00062                                                 {
00063     string temp = s+" ";
00064     temp +=  b? "true":"false";
00065     m_strings.push_back(temp);
00066   }

void Atlfast::HeaderPrinter::add ( const string &   ) 

Definition at line 68 of file HeaderPrinter.cxx.

00068                                         {
00069     m_strings.push_back(s);
00070   }

void Atlfast::HeaderPrinter::print (  )  const

Definition at line 72 of file HeaderPrinter.cxx.

00072                                 {
00073     
00074     cout<<m_fullLine<<endl;
00075     cout<<m_hollowLine<<endl;
00076     cout<<m_title<<endl;
00077     cout<<m_hollowLine<<endl;
00078     std::vector<string>::const_iterator it = m_strings.begin();
00079     std::vector<string>::const_iterator en = m_strings.end();
00080 
00081     for(;it!=en; ++it){
00082       string temp = *it;
00083       if(temp.size()<width-2){
00084         temp = string(1u,'|')+string(1u,' ')+temp;
00085       }
00086       while(temp.size()<width-1){
00087         temp += string(1u,' ');
00088       }
00089       temp += string(1u,'|');
00090       cout<<temp<<endl;
00091     }   
00092     cout<<m_hollowLine<<endl;
00093     cout<<m_fullLine<<endl;
00094     cout<<endl<<endl;
00095     return;
00096   }


Member Data Documentation

unsigned int Atlfast::HeaderPrinter::width [static]

Definition at line 46 of file HeaderPrinter.h.

string Atlfast::HeaderPrinter::m_fullLine [static]

Definition at line 47 of file HeaderPrinter.h.

string Atlfast::HeaderPrinter::m_title [private]

Definition at line 49 of file HeaderPrinter.h.

MsgStream& Atlfast::HeaderPrinter::m_log [private]

Definition at line 50 of file HeaderPrinter.h.

std::vector<string> Atlfast::HeaderPrinter::m_strings [private]

Definition at line 51 of file HeaderPrinter.h.

string Atlfast::HeaderPrinter::m_hollowLine [private]

Definition at line 52 of file HeaderPrinter.h.


The documentation for this class was generated from the following files:
Generated on Fri Sep 21 13:20:56 2007 for AtlfastUtils by  doxygen 1.5.1