codaObject::RunObject Class Reference

Extends SessionObject to accept transition commands from run control, but has no interrupt capability. More...

#include <RunObject.hxx>

Inheritance diagram for codaObject::RunObject:
codaObject::SessionObject codaObject::CodaObject codaObject::InterruptibleObject

List of all members.

Public Member Functions

 RunObject (const string &UDL, const string &name, const string &descr, const string &codaClass="USER", const cMsgSubscriptionConfig *scfg=NULL) throw (CodaException)
 RunObject constructor, invokes SessionObject constructor.
virtual ~RunObject (void) throw ()
 RunObject destructor deletes all callback dispatchers, kills run statistics thread.
int getRunNumber (void) const throw ()
 Returns current run number.
string getRunType (void) const throw ()
 Returns current run type.
virtual void startProcessing (void) throw (CodaException)
 Called to start processing.

Public Attributes

int eventNumber
 Current event count.
double eventRate
 Current event rate.
int dataCount
 Current data count in 4-byte words.
double dataRate
 Current event rate.
float liveTime
 Current live time.

Protected Member Functions

virtual void setDllUserArg (void *arg) throw ()
 Sets dll user arg.
virtual void handleConfigure (const cMsgMessage *msg) throw (CodaException)
 Handles configure request.
virtual void handleDownload (const cMsgMessage *msg) throw (CodaException)
 Handles download request.
virtual void handlePrestart (const cMsgMessage *msg) throw (CodaException)
 Handles prestart request.
virtual void handleGo (const cMsgMessage *msg) throw (CodaException)
 Handles go request.
virtual void handlePause (const cMsgMessage *msg) throw (CodaException)
 Handles pause request.
virtual void handleResume (const cMsgMessage *msg) throw (CodaException)
 Handles resume request.
virtual void handleEnd (const cMsgMessage *msg) throw (CodaException)
 Handles end request.
virtual void handleReset (const cMsgMessage *msg) throw (CodaException)
 Handles reset request.
virtual void handleSetSession (const string &newSession) throw (CodaException)
 Handles set session request.
virtual void handleSetSession (const cMsgMessage *msg) throw (CodaException)
 Handles set session request.
virtual bool download (const string &s) throw (CodaException)
 Implements download transition, dispatches to user routine.
virtual bool prestart (const string &s) throw (CodaException)
 Implements prestart transition, dispatches to user routine.
virtual bool go (const string &s) throw (CodaException)
 Implements go transition, dispatches to user routine.
virtual bool pause (const string &s) throw (CodaException)
 Implements pause transition, dispatches to user routine.
virtual bool resume (const string &s) throw (CodaException)
 Implements resume transition, dispatches to user routine.
virtual bool end (const string &s) throw (CodaException)
 Implements end transition, dispatches to user routine.
virtual bool reset (const string &s) throw (CodaException)
 Implements reset, dispatches to user routine, overrides superclass version.
virtual bool configure (const cMsgMessage *msg) throw (CodaException)
 Calls userConfigure.
virtual bool userConfigure (const string &runConfig) throw (CodaException)
 Default user configure method.
virtual bool userDownload (const string &s) throw (CodaException)
 Default user download method.
virtual bool userPrestart (const string &s) throw (CodaException)
 Default user prestart method.
virtual bool userGo (const string &s) throw (CodaException)
 Default user go method.
virtual bool userPause (const string &s) throw (CodaException)
 Default user pause method.
virtual bool userResume (const string &s) throw (CodaException)
 Default user resume method.
virtual bool userEnd (const string &s) throw (CodaException)
 Default user end method.
virtual bool userReset (const string &s) throw (CodaException)
 Default user reset method.
virtual void fillReport (cMsgMessage *m) throw ()
 fills rc/report/status message
virtual void daLogMsgFill (cMsgMessage &msg) const throw (CodaException)
 Fills daLogMsg with run-specific information.

Protected Attributes

int runNumber
 Current run number.
string runType
 Current run type.
int runStatisticsInterval
 Run statistics calculation interval.
bool hasDLL
 True if has dll library containing transition functions.
string dllFileName
 dll file name.
void * dllHandle
 dll handle.
dllSysStruct dllSysArg
 For passing information into dll functions.
void * dllUserArg
 dll user arg.
dllFuncPtr dllDownload
 Pointer to download function in dll.
dllFuncPtr dllPrestart
 Pointer to prestart function in dll.
dllFuncPtr dllGo
 Pointer to go function in dll.
dllFuncPtr dllPause
 Pointer to pause function in dll.
dllFuncPtr dllResume
 Pointer to resume function in dll.
dllFuncPtr dllEnd
 Pointer to end function in dll.
dllFuncPtr dllReset
 Pointer to reset function in dll.
cMsgCallback * runControlCBD
 Run control message callback dispatcher.
cMsgCallback * runTransitionCBD
 Run transition message callback dispatcher.
pthread_mutex_t runResetMutex
 Mutex for reset command.
pthread_mutex_t runTransitionMutex
 Mutex for run transitions.
pthread_t transitionThreadId
 Transition thread id.
pthread_t runStatisticsThreadId
 Run statistics thread id.
pthreadDispatcher< RunObject,
void *, void * > * 
statisticsThreadDispatcher
 Run statistics pthread dispatcher.

Detailed Description

Extends SessionObject to accept transition commands from run control, but has no interrupt capability.

If interrupt capability is needed use InterruptibleObject.

User customizes a RunObject via override of some of download,prestart,go,pause,resume,end methods. Alternatively, can specify dll containing download,etc. functions.

If dealing with events, user must set eventCount and dataCount as events are sent to the DAQ system.

Warning:
User routines should be pthread-cancelable in case reset command is received.

Definition at line 48 of file RunObject.hxx.


Constructor & Destructor Documentation

RunObject::RunObject ( const string &  udl,
const string &  Name,
const string &  Descr,
const string &  cClass = "USER",
const cMsgSubscriptionConfig *  scfg = NULL 
) throw (CodaException)

RunObject constructor, invokes SessionObject constructor.

Subscribes to additional run-specific subjects.

Parameters:
udl Main cMsg connection udl
name Object name
descr Object description
cClass Coda class of object
scfg cMsg subscription config

Definition at line 52 of file RunObject.cc.

References DALOG_ERROR.

RunObject::~RunObject ( void   )  throw () [virtual]

RunObject destructor deletes all callback dispatchers, kills run statistics thread.

Definition at line 107 of file RunObject.cc.

References codaObject::CodaObject::debug, runControlCBD, runStatisticsThreadId, runTransitionCBD, and statisticsThreadDispatcher.


Member Function Documentation

bool RunObject::configure ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Calls userConfigure.

Parameters:
msg cMsgMessage
Returns:
Current run type.

Definition at line 603 of file RunObject.cc.

void RunObject::daLogMsgFill ( cMsgMessage &  m  )  const throw (CodaException) [protected, virtual]

Fills daLogMsg with run-specific information.

Parameters:
msg Message

Reimplemented from codaObject::SessionObject.

Definition at line 914 of file RunObject.cc.

References codaObject::SessionObject::daLogMsgFill().

bool RunObject::download ( const string &  s  )  throw (CodaException) [protected, virtual]

Implements download transition, dispatches to user routine.

Parameters:
s String from run control
Returns:
true if transition succeeded

Reimplemented in codaObject::InterruptibleObject.

Definition at line 636 of file RunObject.cc.

References DALOG_ERROR, and DALOG_INFO.

Referenced by codaObject::InterruptibleObject::download(), and handleDownload().

bool RunObject::end ( const string &  s  )  throw (CodaException) [protected, virtual]

Implements end transition, dispatches to user routine.

Parameters:
s String from run control
Returns:
true If transition succeeded

Reimplemented in codaObject::InterruptibleObject.

Definition at line 835 of file RunObject.cc.

References DALOG_INFO.

Referenced by codaObject::InterruptibleObject::end(), and handleEnd().

void RunObject::fillReport ( cMsgMessage *  m  )  throw () [protected, virtual]

fills rc/report/status message

Parameters:
m message

Reimplemented from codaObject::SessionObject.

Definition at line 561 of file RunObject.cc.

References codaObject::SessionObject::fillReport().

int RunObject::getRunNumber ( void   )  const throw ()

Returns current run number.

Returns:
Current run number.

Definition at line 578 of file RunObject.cc.

string RunObject::getRunType ( void   )  const throw ()

Returns current run type.

Returns:
Current run type.

Definition at line 591 of file RunObject.cc.

References runType.

bool RunObject::go ( const string &  s  )  throw (CodaException) [protected, virtual]

Implements go transition, dispatches to user routine.

Parameters:
s String from run control
Returns:
true If transition succeeded

Reimplemented in codaObject::InterruptibleObject.

Definition at line 741 of file RunObject.cc.

References DALOG_INFO.

Referenced by handleGo().

void RunObject::handleConfigure ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles configure request.

Parameters:
msg Request message

Definition at line 294 of file RunObject.cc.

void RunObject::handleDownload ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles download request.

Parameters:
msg Incoming message

Definition at line 313 of file RunObject.cc.

References download().

void RunObject::handleEnd ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles end request.

Parameters:
msg Incoming message

Definition at line 378 of file RunObject.cc.

References end().

void RunObject::handleGo ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles go request.

Parameters:
msg Incoming message

Definition at line 339 of file RunObject.cc.

References go().

void RunObject::handlePause ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles pause request.

Parameters:
msg Incoming message

Definition at line 352 of file RunObject.cc.

References pause().

void RunObject::handlePrestart ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles prestart request.

Parameters:
msg Incoming message

Definition at line 326 of file RunObject.cc.

References prestart().

void RunObject::handleReset ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles reset request.

Parameters:
msg Incoming message

Definition at line 391 of file RunObject.cc.

void RunObject::handleResume ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles resume request.

Parameters:
msg Incoming message

Definition at line 365 of file RunObject.cc.

References resume().

void RunObject::handleSetSession ( const cMsgMessage *  msg  )  throw (CodaException) [protected, virtual]

Handles set session request.

Parameters:
msg cMsg request message

Reimplemented from codaObject::SessionObject.

Definition at line 514 of file RunObject.cc.

void RunObject::handleSetSession ( const string &  newSession  )  throw (CodaException) [protected, virtual]

Handles set session request.

Parameters:
newSession New session name

Reimplemented from codaObject::SessionObject.

Definition at line 436 of file RunObject.cc.

References DALOG_ERROR, DALOG_INFO, and codaObject::SessionObject::handleSetSession().

bool RunObject::pause ( const string &  s  )  throw (CodaException) [protected, virtual]

Implements pause transition, dispatches to user routine.

Parameters:
s String from run control
Returns:
true If transition succeeded

Reimplemented in codaObject::InterruptibleObject.

Definition at line 773 of file RunObject.cc.

References DALOG_INFO.

Referenced by handlePause(), and codaObject::InterruptibleObject::pause().

bool RunObject::prestart ( const string &  s  )  throw (CodaException) [protected, virtual]

Implements prestart transition, dispatches to user routine.

Parameters:
s String from run control
Returns:
true If transition succeeded

Reimplemented in codaObject::InterruptibleObject.

Definition at line 702 of file RunObject.cc.

References DALOG_INFO.

Referenced by handlePrestart(), and codaObject::InterruptibleObject::prestart().

bool RunObject::reset ( const string &  s  )  throw (CodaException) [protected, virtual]

Implements reset, dispatches to user routine, overrides superclass version.

Parameters:
s String from run control
Returns:
true If reset succeeded

Reimplemented in codaObject::InterruptibleObject.

Definition at line 866 of file RunObject.cc.

References DALOG_INFO.

Referenced by codaObject::InterruptibleObject::reset().

bool RunObject::resume ( const string &  s  )  throw (CodaException) [protected, virtual]

Implements resume transition, dispatches to user routine.

Parameters:
s String from run control
Returns:
true If transition succeeded

Reimplemented in codaObject::InterruptibleObject.

Definition at line 804 of file RunObject.cc.

References DALOG_INFO.

Referenced by handleResume().

void RunObject::setDllUserArg ( void *  arg  )  throw () [protected, virtual]

Sets dll user arg.

Definition at line 620 of file RunObject.cc.

void RunObject::startProcessing ( void   )  throw (CodaException) [virtual]

Called to start processing.

Launches run statistics thread, then calls SessionObject::startProcessing.

Reimplemented from codaObject::CodaObject.

Definition at line 139 of file RunObject.cc.

References DALOG_ERROR, codaObject::CodaObject::daLogMsg(), codaObject::CodaObject::debug, runStatisticsThreadId, and statisticsThreadDispatcher.

bool RunObject::userConfigure ( const string &  runConfig  )  throw (CodaException) [protected, virtual]

Default user configure method.

Definition at line 928 of file RunObject.cc.

References DALOG_INFO.

bool RunObject::userDownload ( const string &  s  )  throw (CodaException) [protected, virtual]

Default user download method.

Definition at line 936 of file RunObject.cc.

References DALOG_INFO.

bool RunObject::userEnd ( const string &  s  )  throw (CodaException) [protected, virtual]

Default user end method.

Definition at line 976 of file RunObject.cc.

References DALOG_INFO.

bool RunObject::userGo ( const string &  s  )  throw (CodaException) [protected, virtual]

Default user go method.

Definition at line 952 of file RunObject.cc.

References DALOG_INFO.

bool RunObject::userPause ( const string &  s  )  throw (CodaException) [protected, virtual]

Default user pause method.

Definition at line 960 of file RunObject.cc.

References DALOG_INFO.

bool RunObject::userPrestart ( const string &  s  )  throw (CodaException) [protected, virtual]

Default user prestart method.

Definition at line 944 of file RunObject.cc.

References DALOG_INFO.

bool RunObject::userReset ( const string &  s  )  throw (CodaException) [protected, virtual]

Default user reset method.

Definition at line 984 of file RunObject.cc.

References DALOG_INFO.

bool RunObject::userResume ( const string &  s  )  throw (CodaException) [protected, virtual]

Default user resume method.

Definition at line 968 of file RunObject.cc.

References DALOG_INFO.


Member Data Documentation

Current data count in 4-byte words.

Definition at line 119 of file RunObject.hxx.

Current event rate.

Definition at line 120 of file RunObject.hxx.

Pointer to download function in dll.

Definition at line 130 of file RunObject.hxx.

Pointer to end function in dll.

Definition at line 135 of file RunObject.hxx.

dll file name.

Definition at line 126 of file RunObject.hxx.

Pointer to go function in dll.

Definition at line 132 of file RunObject.hxx.

dll handle.

Definition at line 127 of file RunObject.hxx.

Pointer to pause function in dll.

Definition at line 133 of file RunObject.hxx.

Pointer to prestart function in dll.

Definition at line 131 of file RunObject.hxx.

Pointer to reset function in dll.

Definition at line 136 of file RunObject.hxx.

Pointer to resume function in dll.

Definition at line 134 of file RunObject.hxx.

For passing information into dll functions.

Definition at line 128 of file RunObject.hxx.

dll user arg.

Definition at line 129 of file RunObject.hxx.

Current event count.

Definition at line 117 of file RunObject.hxx.

Current event rate.

Definition at line 118 of file RunObject.hxx.

True if has dll library containing transition functions.

Definition at line 125 of file RunObject.hxx.

Current live time.

Definition at line 121 of file RunObject.hxx.

cMsgCallback* codaObject::RunObject::runControlCBD [protected]

Run control message callback dispatcher.

Definition at line 140 of file RunObject.hxx.

Referenced by ~RunObject().

Current run number.

Definition at line 111 of file RunObject.hxx.

pthread_mutex_t codaObject::RunObject::runResetMutex [protected]

Mutex for reset command.

Definition at line 145 of file RunObject.hxx.

Run statistics calculation interval.

Definition at line 113 of file RunObject.hxx.

Run statistics thread id.

Definition at line 148 of file RunObject.hxx.

Referenced by startProcessing(), and ~RunObject().

cMsgCallback* codaObject::RunObject::runTransitionCBD [protected]

Run transition message callback dispatcher.

Definition at line 141 of file RunObject.hxx.

Referenced by ~RunObject().

pthread_mutex_t codaObject::RunObject::runTransitionMutex [protected]

Mutex for run transitions.

Definition at line 146 of file RunObject.hxx.

string codaObject::RunObject::runType [protected]

Current run type.

Definition at line 112 of file RunObject.hxx.

Referenced by getRunType().

Run statistics pthread dispatcher.

Definition at line 150 of file RunObject.hxx.

Referenced by startProcessing(), and ~RunObject().

Transition thread id.

Definition at line 147 of file RunObject.hxx.


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

Generated on 4 Feb 2014 for CodaObject by  doxygen 1.6.1