#include <TGo4CommandInvoker.h>
Public Member Functions | |
virtual void | Invoke (TGo4Command *com) |
virtual void | Invoke () |
virtual | ~TGo4CommandInvoker () |
Int_t | ExecuteFromRemote (TGo4RemoteCommand *remcom) |
Static Public Member Functions | |
static TGo4CommandInvoker * | Instance () |
static void | Register (const char *name, TGo4CommandReceiver *p) |
static void | UnRegister (TGo4CommandReceiver *p) |
static void | SetCommandList (TGo4CommandProtoList *list) |
Protected Member Functions | |
TGo4CommandInvoker () | |
Static Protected Member Functions | |
static TGo4CommandReceiver * | Lookup (const char *name) |
Private Attributes | |
TGo4Command * | fxCommand |
Static Private Attributes | |
static TGo4CommandProtoList * | fxCommandList = 0 |
static TGo4CommandInvoker * | fxInstance = 0 |
static TObjArray * | fxArray = 0 |
static TMutex * | fxMutex = 0 |
Class that knows Command Object; When Client gets the Command it is passed to the Invoker who sets the CommandClient as receiver and calls its Execute method. Decouples CommandClient and Command object circular dependencies
Definition at line 37 of file TGo4CommandInvoker.h.
TGo4CommandInvoker::~TGo4CommandInvoker | ( | ) | [virtual] |
Definition at line 63 of file TGo4CommandInvoker.cxx.
References fxArray, fxCommand, fxCommandList, fxMutex, and GO4TRACE.
TGo4CommandInvoker::TGo4CommandInvoker | ( | ) | [protected] |
Definition at line 51 of file TGo4CommandInvoker.cxx.
References fxArray, fxCommand, fxCommandList, fxMutex, GO4TRACE, and Register().
Referenced by Instance().
Int_t TGo4CommandInvoker::ExecuteFromRemote | ( | TGo4RemoteCommand * | remcom | ) |
Create real command from remote command and invoke it. Used when remote command acts on this invoker as receiver
Definition at line 161 of file TGo4CommandInvoker.cxx.
References fxCommandList, TGo4Command::GetMode(), TGo4Command::GetTaskName(), Invoke(), TGo4CommandProtoList::MakeCommand(), TGo4Command::SetMode(), and TGo4Command::SetTaskName().
Referenced by TGo4RemoteCommand::ExeCom().
TGo4CommandInvoker * TGo4CommandInvoker::Instance | ( | ) | [static] |
Definition at line 74 of file TGo4CommandInvoker.cxx.
References fxInstance, GO4TRACE, and TGo4CommandInvoker().
Referenced by TGo4AnalysisClient::Constructor(), TGo4MainRunnable::Run(), TGo4LocalCommandRunnable::Run(), TGo4AnalysisMainRunnable::Run(), TGo4CommandRunnable::TGo4CommandRunnable(), TGo4ExampleApplication::TGo4ExampleApplication(), TGo4HistogramServer::TGo4HistogramServer(), TGo4Master::TGo4Master(), TGo4ServerTask::TGo4ServerTask(), TGo4Slave::TGo4Slave(), and TGo4Task::TGo4Task().
void TGo4CommandInvoker::Invoke | ( | TGo4Command * | com | ) | [virtual] |
Definition at line 121 of file TGo4CommandInvoker.cxx.
References TGo4Log::Debug(), TGo4Command::ExeCom(), fxMutex, TGo4Command::GetMode(), TGo4Command::GetProtection(), TGo4Command::GetReceiverName(), GO4TRACE, Lookup(), TGo4Command::RefuseCom(), and TGo4Command::SetReceiver().
Referenced by TGo4MainRunnable::Run(), TGo4LocalCommandRunnable::Run(), and TGo4AnalysisMainRunnable::Run().
void TGo4CommandInvoker::Invoke | ( | ) | [virtual] |
Definition at line 138 of file TGo4CommandInvoker.cxx.
References TGo4Command::ExeCom(), fxCommand, fxMutex, TGo4Command::GetReceiverName(), GO4TRACE, Lookup(), and TGo4Command::SetReceiver().
Referenced by ExecuteFromRemote().
TGo4CommandReceiver * TGo4CommandInvoker::Lookup | ( | const char * | name | ) | [static, protected] |
Definition at line 113 of file TGo4CommandInvoker.cxx.
References fxArray, TGo4Pair::GetReceiver(), and GO4TRACE.
Referenced by Invoke().
void TGo4CommandInvoker::Register | ( | const char * | name, | |
TGo4CommandReceiver * | p | |||
) | [static] |
Definition at line 82 of file TGo4CommandInvoker.cxx.
References fxArray, fxMutex, and GO4TRACE.
Referenced by TGo4AnalysisClient::Constructor(), TGo4Analysis::Constructor(), TGo4CommandInvoker(), TGo4ExampleApplication::TGo4ExampleApplication(), TGo4HistogramServer::TGo4HistogramServer(), TGo4Master::TGo4Master(), TGo4ServerTask::TGo4ServerTask(), TGo4Slave::TGo4Slave(), and TGo4Task::TGo4Task().
void TGo4CommandInvoker::SetCommandList | ( | TGo4CommandProtoList * | list | ) | [static] |
Application may exchange standard command list by own subclass with specialized commands, e.g. for analysis control
Definition at line 155 of file TGo4CommandInvoker.cxx.
References fxCommandList.
Referenced by TGo4AnalysisClient::Constructor(), TGo4Analysis::Constructor(), TGo4Slave::TGo4Slave(), and TGo4Task::TGo4Task().
void TGo4CommandInvoker::UnRegister | ( | TGo4CommandReceiver * | p | ) | [static] |
Definition at line 89 of file TGo4CommandInvoker.cxx.
References TGo4Log::Error(), fxArray, fxMutex, TGo4Pair::GetReceiver(), and GO4TRACE.
Referenced by TGo4Analysis::~TGo4Analysis(), TGo4AnalysisClient::~TGo4AnalysisClient(), TGo4ExampleApplication::~TGo4ExampleApplication(), TGo4HistogramServer::~TGo4HistogramServer(), TGo4Master::~TGo4Master(), TGo4ServerTask::~TGo4ServerTask(), TGo4Slave::~TGo4Slave(), and TGo4Task::~TGo4Task().
TObjArray * TGo4CommandInvoker::fxArray = 0 [static, private] |
Definition at line 77 of file TGo4CommandInvoker.h.
Referenced by Lookup(), Register(), TGo4CommandInvoker(), UnRegister(), and ~TGo4CommandInvoker().
TGo4Command* TGo4CommandInvoker::fxCommand [private] |
Definition at line 70 of file TGo4CommandInvoker.h.
Referenced by Invoke(), TGo4CommandInvoker(), and ~TGo4CommandInvoker().
TGo4CommandProtoList * TGo4CommandInvoker::fxCommandList = 0 [static, private] |
For remote commands, invoker will create the requested slave commands from own command list
Definition at line 74 of file TGo4CommandInvoker.h.
Referenced by ExecuteFromRemote(), SetCommandList(), TGo4CommandInvoker(), and ~TGo4CommandInvoker().
TGo4CommandInvoker * TGo4CommandInvoker::fxInstance = 0 [static, private] |
Definition at line 76 of file TGo4CommandInvoker.h.
Referenced by Instance().
TMutex * TGo4CommandInvoker::fxMutex = 0 [static, private] |
Definition at line 78 of file TGo4CommandInvoker.h.
Referenced by Invoke(), Register(), TGo4CommandInvoker(), UnRegister(), and ~TGo4CommandInvoker().