JobCDisplayModule Class Reference

#include <JobCDisplayModule.h>

Inheritance diagram for JobCDisplayModule:
JobCModule

List of all members.

Public Member Functions

 JobCDisplayModule ()
 ~JobCDisplayModule ()
JobCResult Ana (const MomNavigator *mom)
JobCResult Reco (MomNavigator *mom)
void BeginJob ()
void EndJob ()
void BeginFile ()
void EndFile ()
void BeginRun ()
void EndRun ()
void HandleCommand (JobCommand *command)
void Help ()
void Report ()
void Reset ()
JobCResult Get (MomNavigator *mom)
JobCResult Put (const MomNavigator *mom)

Private Member Functions

void Stop (const char *display)
void Start (const char *display)

Private Attributes

JobCModulefDisplayModule

Detailed Description

Definition at line 14 of file JobCDisplayModule.h.


Constructor & Destructor Documentation

JobCDisplayModule::JobCDisplayModule (  ) 

Definition at line 23 of file JobCDisplayModule.cxx.

00023 : fDisplayModule(0) { }

JobCDisplayModule::~JobCDisplayModule (  ) 

Definition at line 27 of file JobCDisplayModule.cxx.

References fDisplayModule, and Stop().

00028 { 
00029   if (fDisplayModule) this->Stop(0);
00030 }


Member Function Documentation

JobCResult JobCDisplayModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 34 of file JobCDisplayModule.cxx.

References JobCModule::Ana(), fDisplayModule, and JobCResult::kAOK.

00035 { 
00036   if (fDisplayModule) {
00037     return fDisplayModule->Ana(mom);
00038   }
00039   return JobCResult::kAOK;
00040 }

void JobCDisplayModule::BeginFile (  )  [virtual]

Implement for notification of begin of file. See GetCurrentFile().

Reimplemented from JobCModule.

Definition at line 83 of file JobCDisplayModule.cxx.

References JobCModule::BeginFile(), and fDisplayModule.

00084 {
00085   if (fDisplayModule) {
00086     fDisplayModule->BeginFile();
00087   }
00088 }

void JobCDisplayModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 54 of file JobCDisplayModule.cxx.

References JobCModule::BeginJob(), and fDisplayModule.

00055 {
00056 //======================================================================
00057 // Executed at the start of a new job
00058 //======================================================================
00059   // Pass the begin job along to the display implementation
00060   if (fDisplayModule) {
00061     fDisplayModule->BeginJob();
00062   }
00063 }

void JobCDisplayModule::BeginRun (  )  [virtual]

Implement for notification of begin of run (meaningful for Daq data only). See GetCurrentRun().

Reimplemented from JobCModule.

Definition at line 101 of file JobCDisplayModule.cxx.

References JobCModule::BeginRun(), and fDisplayModule.

00102 {
00103   if (fDisplayModule) {
00104     fDisplayModule->BeginRun();
00105   }
00106 }

void JobCDisplayModule::EndFile (  )  [virtual]

Implement for notification of end of file. See GetLastFile().

Reimplemented from JobCModule.

Definition at line 92 of file JobCDisplayModule.cxx.

References JobCModule::EndFile(), and fDisplayModule.

00093 {
00094   if (fDisplayModule) {
00095     fDisplayModule->EndFile();
00096   }
00097 }

void JobCDisplayModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 67 of file JobCDisplayModule.cxx.

References JobCModule::EndJob(), and fDisplayModule.

00068 {
00069 //======================================================================
00070 // Executed at the end of a job
00071 //======================================================================
00072   if (fDisplayModule) {
00073     fDisplayModule->EndJob();
00074   }
00075 }

void JobCDisplayModule::EndRun (  )  [virtual]

Implement for notification of end of run (meaningful for Daq data only). See GetLastRun().

Reimplemented from JobCModule.

Definition at line 110 of file JobCDisplayModule.cxx.

References JobCModule::EndRun(), and fDisplayModule.

00111 {
00112   if (fDisplayModule) {
00113     fDisplayModule->EndRun();
00114   }
00115 }

JobCResult JobCDisplayModule::Get ( MomNavigator mom  )  [virtual]

Implement if your module needs to read data from some external source and fill mom

Reimplemented from JobCModule.

Definition at line 181 of file JobCDisplayModule.cxx.

References fDisplayModule, JobCModule::Get(), and JobCResult::kAOK.

00182 {
00183   if (fDisplayModule) {
00184     return fDisplayModule->Get(mom);
00185   }
00186   return JobCResult::kAOK;
00187 }

void JobCDisplayModule::HandleCommand ( JobCommand command  )  [virtual]

Implement to handle a JobCommand

Reimplemented from JobCModule.

Definition at line 119 of file JobCDisplayModule.cxx.

References fDisplayModule, JobCModule::HandleCommand(), JobCommand::PopCmd(), JobCommand::PopOpt(), JobCommand::PushCmd(), Start(), and Stop().

00120 {
00121 //======================================================================
00122 // Handle a parsed text command
00123 //======================================================================
00124   const char* cmd = command->PopCmd();
00125   if (command) {
00126     string cmds(cmd);
00127     if (cmds == "Start") {
00128       const char* dispname = command->PopOpt();
00129       this->Start(dispname);
00130       return;
00131     }
00132     if (cmds == "Stop") {
00133       const char* dispname = command->PopOpt();
00134       this->Stop(dispname);
00135       return;
00136     }
00137   }
00138   
00139   // See if the displays attached know what to do with the command
00140   if (fDisplayModule) {
00141     command->PushCmd();
00142     fDisplayModule->HandleCommand(command);
00143   }
00144 }

void JobCDisplayModule::Help (  )  [virtual]

Implement to spew some useful help to cout

Reimplemented from JobCModule.

Definition at line 148 of file JobCDisplayModule.cxx.

References fDisplayModule, JobCModule::Help(), help(), Msg::kInfo, and MSG.

00149 {
00150   static const char* help = 
00151     "General Display commands:\n"
00152     " /Display/Start <display-name>\n"
00153     " /Display/Stop  <display-name>\n";
00154   
00155   MSG("JobC",Msg::kInfo) << help << endl;
00156   if (fDisplayModule) {
00157     fDisplayModule->Help();
00158   }
00159 }

JobCResult JobCDisplayModule::Put ( const MomNavigator mom  )  [virtual]

Implement if your module needs to write data to some external sink.

Reimplemented from JobCModule.

Definition at line 191 of file JobCDisplayModule.cxx.

References fDisplayModule, JobCResult::kAOK, and JobCModule::Put().

00192 {
00193   if (fDisplayModule) {
00194     return fDisplayModule->Put(mom);
00195   }
00196   return JobCResult::kAOK;
00197 }

JobCResult JobCDisplayModule::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 44 of file JobCDisplayModule.cxx.

References fDisplayModule, JobCResult::kAOK, and JobCModule::Reco().

00045 { 
00046   if (fDisplayModule) {
00047     return fDisplayModule->Reco(mom);
00048   }
00049   return JobCResult::kAOK;
00050 }

void JobCDisplayModule::Report (  )  [virtual]

Implement to spew end of running report

Reimplemented from JobCModule.

Definition at line 163 of file JobCDisplayModule.cxx.

References fDisplayModule, and JobCModule::Report().

00164 {
00165   if (fDisplayModule) {
00166     fDisplayModule->Report();
00167   }
00168 }

void JobCDisplayModule::Reset (  )  [virtual]

Implement to reset oneself

Reimplemented from JobCModule.

Definition at line 172 of file JobCDisplayModule.cxx.

References fDisplayModule, and JobCModule::Reset().

00173 {
00174   if (fDisplayModule) {
00175     fDisplayModule->Reset();
00176   }
00177 }

void JobCDisplayModule::Start ( const char *  display  )  [private]

Definition at line 214 of file JobCDisplayModule.cxx.

References JobCModuleProxy::CreateModule(), fDisplayModule, JobCModuleRegistry::Instance(), Msg::kWarning, JobCModuleRegistry::LookUp(), MSG, and Stop().

Referenced by HandleCommand().

00215 {
00216 //======================================================================
00217 // Purpose: Start a named event display
00218 //======================================================================
00219 
00220   // Figure out the name of the display to start - if none use default
00221   string disname; // name of display to start
00222   if (display != 0 && strlen(display)>0) {
00223     disname = display; // Use given name
00224   }
00225   else {
00226     disname = "MIDAD"; // Set default name
00227   }
00228   
00229   // If we have a display module active, delete it. This module could
00230   // in principle connect to multiple display modules, but for now
00231   // hard coded to be one and only one at a time.
00232   if (fDisplayModule) this->Stop(0);
00233 
00234   // Look up the proxy for the module
00235   JobCModuleProxy* prx = 
00236     JobCModuleRegistry::Instance().LookUp(disname.c_str());
00237   if (prx) {
00238     // Found the proxy - use it to create the module
00239     fDisplayModule = prx->CreateModule();
00240   }
00241   else {
00242     // No proxy found for the display module
00243     MSG("JobC",Msg::kWarning) << 
00244       "No display module '" << disname << "' found." << endl;
00245   }
00246 }

void JobCDisplayModule::Stop ( const char *  display  )  [private]

Definition at line 201 of file JobCDisplayModule.cxx.

References JobCModule::EndJob(), and fDisplayModule.

Referenced by HandleCommand(), Start(), and ~JobCDisplayModule().

00202 {
00203 //======================================================================
00204 // Purpose: Stop a named event display -- currently only one allowed
00205 // at a time so "dispname" is not used
00206 //======================================================================
00207   fDisplayModule->EndJob();
00208   delete fDisplayModule;
00209   fDisplayModule = 0;
00210 }


Member Data Documentation


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1