Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RecJobRecord Class Reference

#include <RecJobRecord.h>

Inheritance diagram for RecJobRecord:

Registry List of all members.

Public Types

typedef enum RecJobRecord::ECodeType CodeType_t
enum  ECodeType { kRoot, kMinosSoft }

Public Member Functions

const char * AsString (ECodeType codetype) const
 RecJobRecord ()
 RecJobRecord (const char *prodname, const char *codename, const char *hostname, const VldTimeStamp &timestamp)
virtual ~RecJobRecord ()
const char * GetProdName () const
const char * GetCodeName () const
const char * GetHostName () const
const VldTimeStampGetTimeStamp () const
std::string GetCodeVersion (ECodeType codetype) const
ReleaseType::Release_t GetProdReleaseType () const
virtual std::ostream & Print (std::ostream &os) const
virtual std::ostream & PrintStream (std::ostream &os) const
 Print to cout (without extraneous bits of Dump()).
virtual void Print (Option_t *option="") const

Static Public Member Functions

void SetGlobalProdName (const char *prodname)
const char * GetGlobalProdName ()

Private Attributes

VldTimeStamp fTimeStamp

Static Private Attributes

std::string fgProdName = ""

Member Typedef Documentation

typedef enum RecJobRecord::ECodeType RecJobRecord::CodeType_t
 


Member Enumeration Documentation

enum RecJobRecord::ECodeType
 

Enumeration values:
kRoot 
kMinosSoft 

Definition at line 36 of file RecJobRecord.h.

00036                           {
00037      kRoot,
00038      kMinosSoft
00039    } CodeType_t;


Constructor & Destructor Documentation

RecJobRecord::RecJobRecord  ) 
 

Definition at line 30 of file RecJobRecord.cxx.

References UtilMCFlag::AsString(), and gSystem().

00030                            {
00031   // Default constructor.  Fills data members from environment.  
00032 
00033   Set("ProdName",fgProdName.c_str());
00034   std::string codename = std::string(AsString(kMinosSoft)) + ":" 
00035           + std::string(gSystem->Getenv("SRT_BASE_RELEASE"));
00036   codename += " " + std::string(AsString(kRoot)) + ":v" 
00037                   + std::string(ROOT_RELEASE);
00038   Set("CodeName",codename.c_str());
00039   Set("HostName",gSystem->HostName());
00040   
00041 }

RecJobRecord::RecJobRecord const char *  prodname,
const char *  codename,
const char *  hostname,
const VldTimeStamp timestamp
 

Definition at line 44 of file RecJobRecord.cxx.

References hostname, and Registry::Set().

00046                                                           : 
00047                            fTimeStamp(timestamp) {
00048   // Normal constructor.  Fills data members from arguments.  To be used
00049   // in special cases when record not created in framework, e.g. for
00050   // gminos produced record.
00051   // Codename should be constructed using format:
00052   // "codetype:version codetype:version codetype:version" ...
00053   // where codetype is standardized as RecJobRecord::AsString(ECodeType type)
00054 
00055   Set("ProdName",prodname);
00056   Set("CodeName",codename);
00057   Set("HostName",hostname);
00058   
00059 }

virtual RecJobRecord::~RecJobRecord  )  [inline, virtual]
 

Definition at line 47 of file RecJobRecord.h.

00047 {}


Member Function Documentation

const char * RecJobRecord::AsString ECodeType  codetype  )  const
 

Definition at line 102 of file RecJobRecord.cxx.

References kMinosSoft, kRoot, and MSG.

Referenced by GetCodeVersion().

00102                                                            {
00103   // Purpose: Get code type AsString
00104 
00105   switch( codetype ) {
00106 
00107     case kRoot:
00108       return "root";
00109 
00110     case kMinosSoft:
00111       return "minossoft";
00112 
00113     default:
00114       MSG("Rec",Msg::kError) << "RecJobRecord::AsString received unknown "
00115                              << "enumerated code type " << codetype 
00116                              << "\nMethod needs updating. Abort." << endl;
00117       abort();
00118   } // end of switch
00119   
00120 }

const char* RecJobRecord::GetCodeName  )  const [inline]
 

Definition at line 53 of file RecJobRecord.h.

References Registry::GetCharString().

Referenced by GetCodeVersion(), and Print().

00053 { return GetCharString("CodeName"); }

string RecJobRecord::GetCodeVersion ECodeType  codetype  )  const
 

Definition at line 123 of file RecJobRecord.cxx.

References AsString(), GetCodeName(), UtilString::StringTok(), and UtilString::ToLower().

00123                                                         {
00124   // Parse the CodeName for the code version corresponding to codetype 
00125   // AsString(type).  
00126   // The format of the CodeName is assumed to be:
00127   // "codetype:version codetype:version codetype:version ..."
00128   // If no matching codetype is found, return empty string.
00129 
00130   string codetype = string(AsString(type)) + ":";
00131   UtilString::ToLower(codetype);
00132   
00133   vector<string> codevec;
00134   UtilString::StringTok(codevec,string(GetCodeName())," ");
00135   
00136   vector<string>::const_iterator citr;
00137   for ( citr = codevec.begin(); citr != codevec.end(); citr++ ) {
00138     string codetok = *citr;
00139     string::size_type pos = codetok.find(codetype);
00140     if ( pos != string::npos ) {
00141       pos += codetype.size();
00142       return codetok.substr(pos);
00143     }
00144   }
00145   
00146   return "";
00147   
00148 }

const char* RecJobRecord::GetGlobalProdName  )  [inline, static]
 

Definition at line 34 of file RecJobRecord.h.

References fgProdName.

00034 { return fgProdName.c_str(); }

const char* RecJobRecord::GetHostName  )  const [inline]
 

Definition at line 55 of file RecJobRecord.h.

References Registry::GetCharString().

Referenced by Print().

00055 { return GetCharString("HostName"); }

const char* RecJobRecord::GetProdName  )  const [inline]
 

Definition at line 51 of file RecJobRecord.h.

References Registry::GetCharString().

Referenced by GetProdReleaseType(), and Print().

00051 { return GetCharString("ProdName"); }

ReleaseType::Release_t RecJobRecord::GetProdReleaseType  )  const
 

Definition at line 151 of file RecJobRecord.cxx.

References GetProdName(), and ReleaseType::GetProductionRelease().

Referenced by RecJobHistory::GetProdReleaseType().

00151                                                             {
00152   // Get release type corresponding to ProdName (e.g. "Dogwood0" or
00153   // "Daikon_04")
00154   // Return ReleaseType::kUnknown if unknown.
00155 
00156   ReleaseType::Release_t release = ReleaseType::kUnknown;
00157     
00158   std::string prodname = GetProdName();
00159   
00160   if ( prodname.empty() ) return release;
00161 
00162   release = ReleaseType::GetProductionRelease(prodname.c_str());
00163   return release;
00164   
00165 } 

const VldTimeStamp& RecJobRecord::GetTimeStamp  )  const [inline]
 

Definition at line 56 of file RecJobRecord.h.

00056 { return fTimeStamp; }

void RecJobRecord::Print Option_t *  option = ""  )  const [virtual]
 

Reimplemented from Registry.

Definition at line 83 of file RecJobRecord.cxx.

References Print().

00083                                                       {
00084   //  Purpose:  Print header in form supported by TObject::Print.
00085 
00086   Print(std::cout);
00087 
00088   return;
00089 
00090 }

std::ostream & RecJobRecord::Print std::ostream &  os  )  const [virtual]
 

Definition at line 62 of file RecJobRecord.cxx.

References VldTimeStamp::AsString(), fTimeStamp, GetCodeName(), GetHostName(), and GetProdName().

Referenced by Print(), and PrintStream().

00062                                                     {
00063   //  Purpose:  Print status of record on ostream.
00064 
00065   std::string prodname = GetProdName();
00066   std::string codename = GetCodeName();
00067   
00068   if ( prodname.empty() ) {
00069     os << "[" << codename.c_str() << ((codename.empty()) ? "" : " ") 
00070        << GetHostName() << " " << fTimeStamp.AsString("s") << "]";
00071   }
00072   else {
00073     os << "[" << prodname.c_str() << " " << codename.c_str() 
00074        << ((codename.empty()) ? "" : " ") 
00075        << GetHostName() << " " << fTimeStamp.AsString("s") << "]";
00076   }
00077   
00078   return os;
00079 
00080 }

std::ostream & RecJobRecord::PrintStream std::ostream &  os  )  const [virtual]
 

Print to cout (without extraneous bits of Dump()).

Reimplemented from Registry.

Definition at line 93 of file RecJobRecord.cxx.

References Print().

00093                                                            {
00094   //  Purpose:  Print status of record on ostream, overriding base class
00095   //            PrintStream method.
00096 
00097   return Print(os);
00098 
00099 }

void RecJobRecord::SetGlobalProdName const char *  prodname  )  [inline, static]
 

Definition at line 33 of file RecJobRecord.h.

References fgProdName.

00033 { fgProdName=prodname; }


Member Data Documentation

std::string RecJobRecord::fgProdName = "" [static, private]
 

Definition at line 24 of file RecJobRecord.cxx.

Referenced by GetGlobalProdName(), and SetGlobalProdName().

VldTimeStamp RecJobRecord::fTimeStamp [private]
 

Definition at line 67 of file RecJobRecord.h.

Referenced by Print().


The documentation for this class was generated from the following files:
Generated on Fri Mar 28 16:10:39 2008 for loon by  doxygen 1.3.9.1