CMS 3D CMS Logo

DQMBaseClient Class Reference

#include <DQMServices/XdaqCollector/interface/DQMBaseClient.h>

Inheritance diagram for DQMBaseClient:

dqm::StateMachine

List of all members.

Public Member Functions

virtual void configure ()=0
void Default (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception)
 DQMBaseClient (xdaq::ApplicationStub *s, std::string name="DQMBaseClient", std::string server="localhost", int port=9090, int reconnect_delay_secs=5, bool actAsServer=false)
virtual void endRun ()=0
virtual void finalize ()
void fireConfiguration (std::string name, std::string server, int port)
virtual void general (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception)
std::string getApplicationURL ()
std::string getContextURL ()
virtual void newRun ()=0
virtual ~DQMBaseClient ()

Protected Attributes

DQMOldReceivermui_
dqm::Updaterupd_

Private Member Functions

void configureAction (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception)
 transition methods to be implemented by the application
void enableAction (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception)
void haltAction (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception)
void nullAction (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception)
void resumeAction (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception)
void suspendAction (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception)

Private Attributes

xdata::Boolean actAsServer_
std::string applicationURL
std::string contextURL
std::string name_
xdata::UnsignedLong port_
xdata::UnsignedLong reconnect_delay_secs_
xdata::String server_
xdata::Vector< xdata::String > subs_


Detailed Description

Definition at line 19 of file DQMBaseClient.h.


Constructor & Destructor Documentation

DQMBaseClient::DQMBaseClient ( xdaq::ApplicationStub *  s,
std::string  name = "DQMBaseClient",
std::string  server = "localhost",
int  port = 9090,
int  reconnect_delay_secs = 5,
bool  actAsServer = false 
)

Definition at line 12 of file DQMBaseClient.cc.

References actAsServer_, applicationURL, dqm::StateMachine::bind(), contextURL, Default(), fireConfiguration(), general(), mui_, name_, port_, reconnect_delay_secs_, server_, and upd_.

00018   : dqm::StateMachine(s)
00019 {
00020   contextURL = getApplicationDescriptor()->getContextDescriptor()->getURL();
00021   applicationURL = contextURL + "/" + getApplicationDescriptor()->getURN();
00022 
00023   mui_    = 0;
00024   upd_    = 0;
00025   name_   = name;
00026   server_ = server;
00027   port_   = port;
00028   reconnect_delay_secs_ = reconnect_delay_secs;
00029   actAsServer_ = actAsServer;
00030 
00031   xgi::bind(this, &DQMBaseClient::Default, "Default");
00032   xgi::bind(this, &DQMBaseClient::general, "general");
00033 
00034   dqm::StateMachine::bind("fsm");
00035 
00036   fireConfiguration(name_, server_, port_);
00037 }

virtual DQMBaseClient::~DQMBaseClient (  )  [inline, virtual]

Definition at line 31 of file DQMBaseClient.h.

References finalize().

00031 {finalize();}


Member Function Documentation

virtual void DQMBaseClient::configure (  )  [pure virtual]

Referenced by configureAction().

void DQMBaseClient::configureAction ( toolbox::Event::Reference  e  )  throw (toolbox::fsm::exception::Exception) [private, virtual]

transition methods to be implemented by the application

Implements dqm::StateMachine.

Definition at line 66 of file DQMBaseClient.cc.

References actAsServer_, configure(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), i, mui_, name_, port_, reconnect_delay_secs_, server_, and subs_.

00068 {
00069   cout << "configureAction called " << endl;
00070   if(!mui_)
00071     {
00072       mui_ = new DQMOldReceiver(server_, port_, name_, reconnect_delay_secs_, actAsServer_);
00073     }
00074 #if 0 // FIXME (LAT): Removed as a feature no longer available.
00075   for(unsigned int i = 0; i < subs_.size(); i++)
00076       mui_->subscribe(*((std::string*)subs_.elementAt(i)));
00077 #endif
00078 
00079   configure();
00080 }

void DQMBaseClient::Default ( xgi::Input *  in,
xgi::Output *  out 
) throw (xgi::exception::Exception)

Reimplemented from dqm::StateMachine.

Definition at line 49 of file DQMBaseClient.cc.

References lat::endl(), and out.

Referenced by DQMBaseClient().

00050 {
00051   *out << cgicc::HTMLDoctype(cgicc::HTMLDoctype::eStrict) << std::endl;
00052   *out << cgicc::html().set("lang", "en").set("dir","ltr") << std::endl;
00053   std::string url = getApplicationDescriptor()->getContextDescriptor()->getURL() + "/" + getApplicationDescriptor()->getURN();
00054   *out << "<frameset rows=\"300,90%\">" << std::endl;
00055   *out << "  <frame src=\"" << url << "/fsm" << "\">" << std::endl;
00056   *out << "  <frame src=\"" << url << "/general" << "\">" << std::endl;
00057   *out << "</frameset>" << std::endl;
00058   *out << cgicc::html() << std::endl;
00059 }

void DQMBaseClient::enableAction ( toolbox::Event::Reference  e  )  throw (toolbox::fsm::exception::Exception) [private, virtual]

Implements dqm::StateMachine.

Definition at line 82 of file DQMBaseClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), mui_, newRun(), and upd_.

00084 {
00085 
00086   if(mui_)
00087     upd_ = new dqm::Updater(mui_);
00088   cout << "enableAction called " << endl;
00089   newRun();
00090 }

virtual void DQMBaseClient::endRun (  )  [pure virtual]

Referenced by haltAction().

virtual void DQMBaseClient::finalize ( void   )  [inline, virtual]

Definition at line 37 of file DQMBaseClient.h.

Referenced by ~DQMBaseClient().

00037 {};

void DQMBaseClient::fireConfiguration ( std::string  name,
std::string  server,
int  port 
)

Definition at line 39 of file DQMBaseClient.cc.

References actAsServer_, port_, reconnect_delay_secs_, server_, and subs_.

Referenced by DQMBaseClient().

00040 {
00041   xdata::InfoSpace *sp = getApplicationInfoSpace();
00042   sp->fireItemAvailable("serverHost",&server_);
00043   sp->fireItemAvailable("serverPort",&port_);
00044   sp->fireItemAvailable("subscribeList",&subs_);
00045   sp->fireItemAvailable("actAsServer",&actAsServer_);
00046   sp->fireItemAvailable("reconnectDelaySecs",&reconnect_delay_secs_);
00047 }

void DQMBaseClient::general ( xgi::Input *  in,
xgi::Output *  out 
) throw (xgi::exception::Exception) [virtual]

Definition at line 61 of file DQMBaseClient.cc.

References lat::endl(), and out.

Referenced by DQMBaseClient().

00062 {
00063   *out << "General access to client info " << std::endl;
00064 }

std::string DQMBaseClient::getApplicationURL (  )  [inline]

Definition at line 39 of file DQMBaseClient.h.

References applicationURL.

00040     {
00041       return applicationURL;
00042     }

std::string DQMBaseClient::getContextURL (  )  [inline]

Definition at line 43 of file DQMBaseClient.h.

References contextURL.

00044     {
00045       return contextURL;
00046     }

void DQMBaseClient::haltAction ( toolbox::Event::Reference  e  )  throw (toolbox::fsm::exception::Exception) [private, virtual]

Implements dqm::StateMachine.

Definition at line 107 of file DQMBaseClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), endRun(), dqm::Updater::setStopped(), and upd_.

00109 {
00110   cout << "haltAction called " << endl;
00111   upd_->setStopped();
00112   delete upd_;
00113   endRun();
00114 }

virtual void DQMBaseClient::newRun (  )  [pure virtual]

Referenced by enableAction().

void DQMBaseClient::nullAction ( toolbox::Event::Reference  e  )  throw (toolbox::fsm::exception::Exception) [private, virtual]

Implements dqm::StateMachine.

Definition at line 116 of file DQMBaseClient.cc.

00117 {
00118   //this action has no effect. A warning is issued to this end
00119   LOG4CPLUS_WARN(this->getApplicationLogger(),
00120                     "Null action invoked");
00121 }

void DQMBaseClient::resumeAction ( toolbox::Event::Reference  e  )  throw (toolbox::fsm::exception::Exception) [private, virtual]

Implements dqm::StateMachine.

Definition at line 100 of file DQMBaseClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00102 {
00103   cout << "resumeAction called " << endl;
00104 }

void DQMBaseClient::suspendAction ( toolbox::Event::Reference  e  )  throw (toolbox::fsm::exception::Exception) [private, virtual]

Implements dqm::StateMachine.

Definition at line 93 of file DQMBaseClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00095 {
00096   cout << "suspendAction called " << endl;
00097 }


Member Data Documentation

xdata::Boolean DQMBaseClient::actAsServer_ [private]

Definition at line 83 of file DQMBaseClient.h.

Referenced by configureAction(), DQMBaseClient(), and fireConfiguration().

std::string DQMBaseClient::applicationURL [private]

Definition at line 74 of file DQMBaseClient.h.

Referenced by DQMBaseClient(), and getApplicationURL().

std::string DQMBaseClient::contextURL [private]

Definition at line 73 of file DQMBaseClient.h.

Referenced by DQMBaseClient(), and getContextURL().

DQMOldReceiver* DQMBaseClient::mui_ [protected]

Definition at line 50 of file DQMBaseClient.h.

Referenced by configureAction(), DQMBaseClient(), and enableAction().

std::string DQMBaseClient::name_ [private]

Definition at line 76 of file DQMBaseClient.h.

Referenced by configureAction(), and DQMBaseClient().

xdata::UnsignedLong DQMBaseClient::port_ [private]

Definition at line 80 of file DQMBaseClient.h.

Referenced by configureAction(), DQMBaseClient(), and fireConfiguration().

xdata::UnsignedLong DQMBaseClient::reconnect_delay_secs_ [private]

Definition at line 81 of file DQMBaseClient.h.

Referenced by configureAction(), DQMBaseClient(), and fireConfiguration().

xdata::String DQMBaseClient::server_ [private]

Definition at line 78 of file DQMBaseClient.h.

Referenced by configureAction(), DQMBaseClient(), and fireConfiguration().

xdata::Vector<xdata::String> DQMBaseClient::subs_ [private]

Definition at line 85 of file DQMBaseClient.h.

Referenced by configureAction(), and fireConfiguration().

dqm::Updater* DQMBaseClient::upd_ [protected]

Definition at line 51 of file DQMBaseClient.h.

Referenced by DQMBaseClient(), enableAction(), and haltAction().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:29 2009 for CMSSW by  doxygen 1.5.4