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 31 of file RecJobRecord.cxx.

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

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

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

Definition at line 45 of file RecJobRecord.cxx.

References hostname, and Registry::Set().

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

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 103 of file RecJobRecord.cxx.

References kMinosSoft, kRoot, and MSG.

Referenced by GetCodeVersion().

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

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 124 of file RecJobRecord.cxx.

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

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

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 152 of file RecJobRecord.cxx.

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

Referenced by RecJobHistory::GetProdReleaseType().

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

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 84 of file RecJobRecord.cxx.

References Print().

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

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

Definition at line 63 of file RecJobRecord.cxx.

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

Referenced by Print(), and PrintStream().

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

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

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

Reimplemented from Registry.

Definition at line 94 of file RecJobRecord.cxx.

References Print().

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

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 25 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 Mon Feb 15 11:10:11 2010 for loon by  doxygen 1.3.9.1