12 #ifndef RBSHAREDRESOURCES_H_
13 #define RBSHAREDRESOURCES_H_
24 #include "boost/statechart/event_base.hpp"
25 #include <boost/shared_ptr.hpp>
27 #include "xdata/InfoSpace.h"
28 #include "xdata/Integer32.h"
29 #include "xdata/UnsignedInteger32.h"
30 #include "xdata/Integer.h"
31 #include "xdata/Double.h"
32 #include "xdata/Boolean.h"
33 #include "xdata/String.h"
35 #include "toolbox/task/Action.h"
36 #include "toolbox/task/WorkLoop.h"
37 #include "toolbox/task/WorkLoopFactory.h"
39 #include <semaphore.h>
45 class FUResourceBroker;
47 namespace rb_statemachine {
49 typedef boost::shared_ptr<boost::statechart::event_base>
EventPtr;
108 while (0 != sem_wait(&
lock_)) {
109 if (errno != EINTR) {
110 LOG4CPLUS_ERROR(
log_,
"Cannot obtain lock on sem LOCK!");
120 if (errno != EINTR) {
121 LOG4CPLUS_ERROR(
log_,
"Cannot obtain lock on sem accessToResourceStructureLock_!");
158 bool watching(toolbox::task::WorkLoop* wl);
168 bool sendData(toolbox::task::WorkLoop* wl);
177 bool sendDqm(toolbox::task::WorkLoop* wl);
186 bool discard(toolbox::task::WorkLoop* wl);
xdata::String smClassName_
xdata::UnsignedInteger32 nbSentEvents_
void cancelAllWorkloops()
void updateExternalState(std::string newState)
double deltaT(const struct timeval *start, const struct timeval *end)
ActionSignature_t * asDiscard_
ActionSignature_t * asWatching_
xdata::String buClassName_
ActionSignature_t * asSendData_
xdata::Integer freeResRequiredForAllocate_
xdata::UnsignedInteger32 recoCellSize_
void updateGUIExternalState(std::string newState)
bool discard(toolbox::task::WorkLoop *wl)
xdata::UnsignedInteger32 nbDiscardedEvents_
xdata::UnsignedInteger32 nbDataDiscardReceived_
boost::shared_ptr< SharedResources > SharedResourcesPtr_t
xdata::UnsignedInteger32 nbProcessedEvents_
xdata::UnsignedInteger32 nbTakeReceived_
sem_t accessToResourceStructureLock_
xdata::UnsignedInteger32 nbRawCells_
void setFsmPointer(RBStateMachine *const fsm)
xdata::UnsignedInteger32 deltaN_
xdata::Double deltaSumOfSquares_
xdata::UnsignedInteger32 nbAllocateSent_
boost::shared_ptr< boost::statechart::event_base > EventPtr
xdata::UnsignedInteger32 highestEolReceived_
xdata::UnsignedInteger32 resourceStructureTimeout_
xdata::UnsignedInteger32 dataErrorFlag_
xdata::UnsignedInteger32 smInstance_
xdata::UnsignedInteger32 nbTimeoutsWithEvent_
xdata::UnsignedInteger32 nbLostEvents_
xdata::UnsignedInteger32 doDumpEvents_
xdata::Boolean segmentationMode_
uint64_t sumOfSquaresLast_
bool sendData(toolbox::task::WorkLoop *wl)
toolbox::mem::Pool * i2oPool_
xdata::UnsignedInteger32 nbSentErrorEvents_
WorkLoop_t * wlMonitoring_
xdata::UnsignedInteger32 nbDqmCells_
xdata::UnsignedInteger32 monSleepSec_
xdata::UnsignedInteger32 nbDqmDiscardReceived_
bool sendDqm(toolbox::task::WorkLoop *wl)
bool watching(toolbox::task::WorkLoop *wl)
xdata::UnsignedInteger32 deltaSumOfSizes_
ActionSignature_t * asMonitoring_
ActionSignature_t * asSendDqm_
void startSendDqmWorkLoop()
void updateInternalState(std::string newState)
xdata::UnsignedInteger32 nbEolPosted_
xdata::UnsignedInteger32 buInstance_
xdata::Double throughput_
void printWorkLoopStatus()
xdata::UnsignedInteger32 nbSentDqmEvents_
uint16_t mem[nChs][nEvts]
xdata::String reasonForFailed_
void startDiscardWorkLoop()
void startSendDataWorkLoop()
xdata::UnsignedInteger32 nbDataErrors_
xdata::UnsignedInteger32 nbReceivedEvents_
xdata::UnsignedInteger32 watchSleepSec_
xdata::UnsignedInteger32 nbAllocatedEvents_
xdata::UnsignedInteger32 nbPendingSMDiscards_
void updateGUIInternalState(std::string newState)
xdata::Boolean useEvmBoard_
xdata::UnsignedInteger32 nbReceivedEol_
xdata::UnsignedInteger32 nbPendingRequests_
unsigned long long uint64_t
IPCMethod * resourceStructure_
xdata::UnsignedInteger32 nbRecoCells_
xdata::UnsignedInteger32 runNumber_
xdata::Boolean doFedIdCheck_
xdata::UnsignedInteger32 nbPendingSMDqmDiscards_
bool monitoring(toolbox::task::WorkLoop *wl)
xdata::Boolean processKillerEnabled_
void startWatchingWorkLoop()
xdata::UnsignedInteger32 nbTimeoutsWithoutEvent_
void startMonitoringWorkLoop()
xdata::UnsignedInteger32 doCrcCheck_
xdata::UnsignedInteger32 nbClients_
xdata::Boolean useMessageQueueIPC_
SharedResources(Logger log)
xdata::String clientPrcIds_
struct timeval monStartTime_
xdata::UnsignedInteger32 rawCellSize_
toolbox::task::WorkLoop WorkLoop_t
xdata::UnsignedInteger32 dqmCellSize_
void goToFailedState(evf::Exception &e)
toolbox::task::ActionSignature ActionSignature_t
xdata::UnsignedInteger32 nbCrcErrors_
void configureResources(xdaq::Application *app)
xdata::Boolean doDropEvents_
xdata::UnsignedInteger32 timeOutSec_
xdata::UnsignedInteger32 nbEolDiscarded_