CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FUResourceBroker.h
Go to the documentation of this file.
1 //
3 // FUResourceBroker
4 // ----------------
5 //
6 // 10/20/2006 Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
7 // 20/01/2012 Andrei Spataru <aspataru@cern.ch>
9 
10 #ifndef FURESOURCEBROKER_H
11 #define FURESOURCEBROKER_H 1
12 
18 
19 #include "xdaq/Application.h"
20 #include "xdaq/NamespaceURI.h"
21 #include "xdata/InfoSpace.h"
22 #include "xdata/String.h"
23 #include "xdata/Boolean.h"
24 #include "xdata/UnsignedInteger32.h"
25 #include "xdata/Double.h"
26 #include "i2o/exception/Exception.h"
27 
28 #include "interface/shared/frl_header.h"
29 #include "interface/shared/fed_header.h"
30 #include "interface/shared/fed_trailer.h"
31 
32 #include <vector>
33 #include <string>
34 #include <semaphore.h>
35 #include <sys/time.h>
36 
37 namespace evf {
38 
39 class BUProxy;
40 class SMProxy;
41 class EvffedFillerRB;
42 
50 class FUResourceBroker: public xdaq::Application, public xdata::ActionListener {
51 
52 public:
53  //
54  // xdaq instantiator macro
55  //
57 
58  //
59  // construction/destruction
60  //
61  FUResourceBroker(xdaq::ApplicationStub *s);
62  virtual ~FUResourceBroker();
63 
64  //
65  // public member functions
66  //
67 
71  xoap::MessageReference handleFSMSoapMessage(xoap::MessageReference msg)
73 
77  void I2O_FU_TAKE_Callback(toolbox::mem::Reference *bufRef) throw(i2o::exception::Exception);
78 
82  void I2O_FU_DATA_DISCARD_Callback(toolbox::mem::Reference *bufRef) throw(i2o::exception::Exception);
83 
87  void I2O_FU_DQM_DISCARD_Callback(toolbox::mem::Reference *bufRef) throw(i2o::exception::Exception);
88 
92  void I2O_EVM_LUMISECTION_Callback(toolbox::mem::Reference *bufRef) throw(i2o::exception::Exception);
93 
94  // Hyper DAQ web page(s) [see Utilities/WebGUI]
97  void customWebPage(xgi::Input *in, xgi::Output *out)
99 
103  void actionPerformed(xdata::Event& e);
104 
105  unsigned int instanceNumber() const {
106  return instance_.value_;
107  }
108 
109 public:
110  static const int CRC_ERROR_SHIFT = 0x0;
111  static const int DATA_ERROR_SHIFT = 0x1;
112  static const int LOST_ERROR_SHIFT = 0x2;
113  static const int TIMEOUT_NOEVENT_ERROR_SHIFT = 0x3;
114  static const int TIMEOUT_EVENT_ERROR_SHIFT = 0x4;
115  static const int SENT_ERREVENT_ERROR_SHIFT = 0x5;
116 
117 private:
118  //
119  // private member functions
120  //
121  void exportParameters();
123  bool waitForStateChange(std::string name, int timeoutMicroSec);
124 
125 private:
126  //
127  // member data
128  //
129  // Event scheduler, owned by FUResourceBroker
131 
132  // Shared Resources
134 
135  // Finite state machine
137 
138  // monitored parameters
139  xdata::String url_;
140  xdata::String class_;
141  xdata::UnsignedInteger32 instance_;
142 };
143 
144 } // namespace evf
145 
146 
147 #endif
static const int SENT_ERREVENT_ERROR_SHIFT
#define Input(cl)
Definition: vmac.h:189
FUResourceBroker(xdaq::ApplicationStub *s)
void I2O_FU_TAKE_Callback(toolbox::mem::Reference *bufRef)
boost::shared_ptr< SharedResources > SharedResourcesPtr_t
void customWebPage(xgi::Input *in, xgi::Output *out)
bool waitForStateChange(std::string name, int timeoutMicroSec)
static const int LOST_ERROR_SHIFT
void I2O_FU_DATA_DISCARD_Callback(toolbox::mem::Reference *bufRef)
unsigned int instanceNumber() const
void I2O_FU_DQM_DISCARD_Callback(toolbox::mem::Reference *bufRef)
rb_statemachine::SharedResourcesPtr_t res_
rb_statemachine::SMEventScheduler * eventScheduler_
xoap::MessageReference handleFSMSoapMessage(xoap::MessageReference msg)
rb_statemachine::RBStateMachinePtr fsm_
static const int TIMEOUT_EVENT_ERROR_SHIFT
tuple out
Definition: dbtoconf.py:99
void actionPerformed(xdata::Event &e)
boost::shared_ptr< RBStateMachine > RBStateMachinePtr
static const int CRC_ERROR_SHIFT
static const int TIMEOUT_NOEVENT_ERROR_SHIFT
#define Output(cl)
Definition: vmac.h:193
void I2O_EVM_LUMISECTION_Callback(toolbox::mem::Reference *bufRef)
static const int DATA_ERROR_SHIFT
xdata::UnsignedInteger32 instance_
void webPageRequest(xgi::Input *in, xgi::Output *out)