JobCMethod Class Reference

#include <JobCMethod.h>

List of all members.

Public Types

enum  EMethod {
  kVoidMethod = 0, kGet = 1, kPut = 2, kAna = 3,
  kReco = 4
}
typedef enum JobCMethod::EMethod Method_t

Public Member Functions

 JobCMethod (Method_t code)
bool Exists (const JobCModule *module) const
const char * GetName () const
int operator== (Method_t rhs) const
int operator!= (Method_t rhs) const
JobCResult Execute (JobCModule *module, MomNavigator *mom) const

Static Public Member Functions

static const JobCMethodGetMethodByName (const string &name)

Private Attributes

Method_t fMethodCode

Detailed Description

Definition at line 29 of file JobCMethod.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kVoidMethod 
kGet 
kPut 
kAna 
kReco 

Definition at line 33 of file JobCMethod.h.

00033                        {
00034     kVoidMethod     =0,
00035     kGet            =1,
00036     kPut            =2,
00037     kAna            =3,
00038     kReco           =4
00039   } Method_t;


Constructor & Destructor Documentation

JobCMethod::JobCMethod ( JobCMethod::Method_t  code  ) 

Definition at line 54 of file JobCMethod.cxx.

00054 : fMethodCode(code) { }


Member Function Documentation

JobCResult JobCMethod::Execute ( JobCModule module,
MomNavigator mom 
) const

Definition at line 58 of file JobCMethod.cxx.

References JobCModule::Ana(), fMethodCode, JobCModule::Get(), kAna, JobCResult::kFatal, Msg::kFatal, kGet, kPut, kReco, MSG, JobCModule::Put(), and JobCModule::Reco().

Referenced by JobCNode::Execute().

00059 {
00060 //======================================================================
00061 // Purpose: Pass the "MINOSObjectMap" to a specific method of a module
00062 //          for processing
00063 //
00064 // Inputs: mom - pointer to the "MINOSObjectMap"
00065 //         mod - pointer to a a job module
00066 //
00067 // Returns: Pass/Fail/NoDecision
00068 //======================================================================
00069   switch(fMethodCode) {
00070   case JobCMethod::kGet:            return mod->Get(mom);
00071   case JobCMethod::kPut:            return mod->Put(mom);
00072   case JobCMethod::kAna:            return mod->Ana(mom);
00073   case JobCMethod::kReco:           return mod->Reco(mom);
00074   default:
00075     MSG("JobC", Msg::kFatal) 
00076       << "Attempt to execute invalid JobCMethod. Code=" 
00077       << (int)fMethodCode << "\n";
00078     abort();
00079     break;
00080   }
00081   // Should never get here but this keeps compilers quiet
00082   return JobCResult::kFatal;
00083 }

bool JobCMethod::Exists ( const JobCModule module  )  const

Definition at line 87 of file JobCMethod.cxx.

Referenced by JobCNode::JobCNode().

00088 {
00089 //======================================================================
00090 // Purpose: Test if a module implements this method
00091 // 
00092 // Note: I can't think of a good way to do this yet so for now this
00093 // does nothing
00094 //======================================================================
00095   return true;
00096 }

const JobCMethod * JobCMethod::GetMethodByName ( const string &  name  )  [static]

Definition at line 23 of file JobCMethod.cxx.

References kAna, Msg::kError, kGet, kPut, kReco, kVoidMethod, and MSG.

Referenced by JobCPath::CreateNode().

00024 {
00025 //======================================================================
00026 // Return a pointer to a method specified name name m
00027 //======================================================================
00028   if (m == "Get") {
00029     static const JobCMethod get(JobCMethod::kGet);
00030     return &get;
00031   }
00032   if (m == "Put") {
00033     static const JobCMethod put(JobCMethod::kPut);
00034     return &put;
00035   }
00036   if (m == "Ana") {
00037     static const JobCMethod ana(JobCMethod::kAna);
00038     return &ana;
00039   }
00040   if (m == "Reco") {
00041     static const JobCMethod reco(JobCMethod::kReco);
00042     return &reco;
00043   }
00044   if (m == "Void") {
00045     static const JobCMethod voidmethod(JobCMethod::kVoidMethod);
00046     return &voidmethod;
00047   }
00048   MSG("JobC",Msg::kError) << "method name = " << m << "\n";
00049   return 0;
00050 }

const char * JobCMethod::GetName (  )  const

Definition at line 100 of file JobCMethod.cxx.

References fMethodCode.

Referenced by JobCPath::CreateNode(), and JobCNode::MatchModuleMethod().

00101 {
00102 //======================================================================
00103 // Purpose: What is the name of this Module??
00104 // Returns: The name of this module
00105 //======================================================================
00106   // The order and content of gsMethodName and gsMethodCode must match
00107   // exactly
00108   static const char *gsMethodName[] = {
00109     "Void",
00110     "Get",
00111     "Put",
00112     "Ana",
00113     "Reco",
00114   };
00115   return gsMethodName[fMethodCode];
00116 }

int JobCMethod::operator!= ( JobCMethod::Method_t  rhs  )  const

Definition at line 132 of file JobCMethod.cxx.

References fMethodCode.

00133 {
00134 //======================================================================
00135 // Purpose: Test for equality betweeb two methods
00136 //
00137 // Returns: true/false (0 or 1)
00138 //======================================================================
00139   return (fMethodCode != rhs);
00140 }

int JobCMethod::operator== ( JobCMethod::Method_t  rhs  )  const

Definition at line 120 of file JobCMethod.cxx.

References fMethodCode.

00121 {
00122 //======================================================================
00123 // Purpose: Test for equality betweeb two methods
00124 //
00125 // Returns: true/false (0 or 1)
00126 //======================================================================
00127   return (fMethodCode == rhs);
00128 }


Member Data Documentation

Definition at line 54 of file JobCMethod.h.

Referenced by Execute(), GetName(), operator!=(), and operator==().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1