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

JobCMethod Class Reference

#include <JobCMethod.h>

List of all members.

Public Types

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

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

const JobCMethodGetMethodByName (const string &name)

Private Attributes

Method_t fMethodCode


Member Typedef Documentation

typedef enum JobCMethod::EMethod JobCMethod::Method_t
 


Member Enumeration Documentation

enum JobCMethod::EMethod
 

Enumeration values:
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 Method_t  code  ) 
 

Definition at line 53 of file JobCMethod.cxx.

00053 : fMethodCode(code) { }


Member Function Documentation

JobCResult JobCMethod::Execute JobCModule module,
MomNavigator mom
const
 

Definition at line 57 of file JobCMethod.cxx.

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

Referenced by JobCNode::Execute().

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

bool JobCMethod::Exists const JobCModule module  )  const
 

Definition at line 86 of file JobCMethod.cxx.

Referenced by JobCNode::JobCNode().

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

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

Definition at line 22 of file JobCMethod.cxx.

References kAna, kGet, kPut, kReco, kVoidMethod, and MSG.

Referenced by JobCPath::CreateNode().

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

const char * JobCMethod::GetName  )  const
 

Definition at line 99 of file JobCMethod.cxx.

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

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

int JobCMethod::operator!= Method_t  rhs  )  const
 

Definition at line 131 of file JobCMethod.cxx.

References fMethodCode.

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

int JobCMethod::operator== Method_t  rhs  )  const
 

Definition at line 119 of file JobCMethod.cxx.

References fMethodCode.

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


Member Data Documentation

Method_t JobCMethod::fMethodCode [private]
 

Definition at line 54 of file JobCMethod.h.

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


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:21 2010 for loon by  doxygen 1.3.9.1