ROOTANA
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Static Private Attributes
TMidasOnline Class Reference

#include <TMidasOnline.h>

Collaboration diagram for TMidasOnline:
Collaboration graph
[legend]

Public Types

typedef void(* TransitionHandler) (int transition, int run_number, int trans_time)
 User handler for run state transition events. More...
 
typedef void(* EventHandler) (const void *header, const void *data, int length)
 User handler for data events. More...
 

Public Member Functions

int connect (const char *hostname, const char *exptname, const char *progname)
 Connect to MIDAS experiment. More...
 
int disconnect ()
 Disconnect from MIDAS. More...
 
bool poll (int mdelay)
 Check for all MIDAS events (new data events, run transitions) More...
 
bool sleep (int mdelay)
 Sleep while checking for and answering MIDAS RPC requests (run transitions, etc) More...
 
void registerTransitions ()
 Ask MIDAS to tell us about run transitions. More...
 
void setTransitionHandlers (TransitionHandler start, TransitionHandler stop, TransitionHandler pause, TransitionHandler resume)
 Specify user handlers for run transitions. More...
 
bool checkTransitions ()
 Check for pending transitions, call user handlers. Returns "true" if there were transitions. More...
 
void setEventHandler (EventHandler handler)
 Specify user handler for data events. More...
 
int eventRequest (const char *bufferName, int eventId, int triggerMask, int samplingType, bool poll=false)
 Request data for delivery via callback (setEventHandler) or by polling (via receiveEvent) More...
 
void deleteEventRequest (int requestId)
 Delete data request. More...
 
int receiveEvent (int requestId, void *pevent, int size, bool async)
 Receive event by polling. More...
 
int getBufferLevel ()
 Get buffer level (ie the number of bytes in buffer) More...
 
int getBufferSize ()
 Get buffer size. More...
 
void RegisterHandler (TMHandlerInterface *h)
 

Static Public Member Functions

static TMidasOnlineinstance ()
 

Data Fields

std::string fHostname
 hostname where the mserver is running, blank if using shared memory More...
 
std::string fExptname
 experiment name, blank if only one experiment defined in exptab More...
 
HNDLE fDB
 ODB handle. More...
 
TransitionHandler fStartHandler
 
TransitionHandler fStopHandler
 
TransitionHandler fPauseHandler
 
TransitionHandler fResumeHandler
 
EventRequestfEventRequests
 
EventHandler fEventHandler
 
std::vector< TMHandlerInterface * > fHandlers
 

Private Member Functions

 TMidasOnline ()
 default constructor is private for singleton classes More...
 
virtual ~TMidasOnline ()
 destructor is private for singleton classes More...
 

Static Private Attributes

static TMidasOnlinegfMidas = NULL
 

Detailed Description

Definition at line 43 of file TMidasOnline.h.

Member Typedef Documentation

◆ EventHandler

typedef void(* TMidasOnline::EventHandler) (const void *header, const void *data, int length)

User handler for data events.

Definition at line 51 of file TMidasOnline.h.

◆ TransitionHandler

typedef void(* TMidasOnline::TransitionHandler) (int transition, int run_number, int trans_time)

User handler for run state transition events.

Definition at line 48 of file TMidasOnline.h.

Constructor & Destructor Documentation

◆ TMidasOnline()

TMidasOnline::TMidasOnline ( )
private

default constructor is private for singleton classes

Definition at line 23 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ ~TMidasOnline()

TMidasOnline::~TMidasOnline ( )
privatevirtual

destructor is private for singleton classes

Definition at line 34 of file TMidasOnline.cxx.

Here is the call graph for this function:

Member Function Documentation

◆ checkTransitions()

bool TMidasOnline::checkTransitions ( )

Check for pending transitions, call user handlers. Returns "true" if there were transitions.

Definition at line 122 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ connect()

int TMidasOnline::connect ( const char *  hostname,
const char *  exptname,
const char *  progname 
)

Connect to MIDAS experiment.

Definition at line 48 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ deleteEventRequest()

void TMidasOnline::deleteEventRequest ( int  requestId)

Delete data request.

Definition at line 356 of file TMidasOnline.cxx.

◆ disconnect()

int TMidasOnline::disconnect ( )

Disconnect from MIDAS.

Definition at line 94 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ eventRequest()

int TMidasOnline::eventRequest ( const char *  bufferName,
int  eventId,
int  triggerMask,
int  samplingType,
bool  poll = false 
)

Request data for delivery via callback (setEventHandler) or by polling (via receiveEvent)

Definition at line 292 of file TMidasOnline.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBufferLevel()

int TMidasOnline::getBufferLevel ( )

Get buffer level (ie the number of bytes in buffer)

Definition at line 335 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ getBufferSize()

int TMidasOnline::getBufferSize ( )

Get buffer size.

Definition at line 346 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ instance()

TMidasOnline * TMidasOnline::instance ( )
static

TMidasOnline is a singleton class. Call instance() to get a reference to the one instance of this class.

Definition at line 40 of file TMidasOnline.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poll()

bool TMidasOnline::poll ( int  mdelay)

Check for all MIDAS events (new data events, run transitions)

Definition at line 165 of file TMidasOnline.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ receiveEvent()

int TMidasOnline::receiveEvent ( int  requestId,
void *  pevent,
int  size,
bool  async 
)

Receive event by polling.

Definition at line 244 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ RegisterHandler()

void TMidasOnline::RegisterHandler ( TMHandlerInterface h)

Definition at line 373 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ registerTransitions()

void TMidasOnline::registerTransitions ( )

Ask MIDAS to tell us about run transitions.

Definition at line 106 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ setEventHandler()

void TMidasOnline::setEventHandler ( EventHandler  handler)

Specify user handler for data events.

Definition at line 215 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ setTransitionHandlers()

void TMidasOnline::setTransitionHandlers ( TransitionHandler  start,
TransitionHandler  stop,
TransitionHandler  pause,
TransitionHandler  resume 
)

Specify user handlers for run transitions.

Definition at line 114 of file TMidasOnline.cxx.

Here is the caller graph for this function:

◆ sleep()

bool TMidasOnline::sleep ( int  mdelay)

Sleep while checking for and answering MIDAS RPC requests (run transitions, etc)

Definition at line 183 of file TMidasOnline.cxx.

Here is the call graph for this function:

Field Documentation

◆ fDB

HNDLE TMidasOnline::fDB

ODB handle.

Definition at line 58 of file TMidasOnline.h.

◆ fEventHandler

EventHandler TMidasOnline::fEventHandler

Definition at line 66 of file TMidasOnline.h.

◆ fEventRequests

EventRequest* TMidasOnline::fEventRequests

Definition at line 65 of file TMidasOnline.h.

◆ fExptname

std::string TMidasOnline::fExptname

experiment name, blank if only one experiment defined in exptab

Definition at line 56 of file TMidasOnline.h.

◆ fHandlers

std::vector<TMHandlerInterface*> TMidasOnline::fHandlers

Definition at line 68 of file TMidasOnline.h.

◆ fHostname

std::string TMidasOnline::fHostname

hostname where the mserver is running, blank if using shared memory

Definition at line 55 of file TMidasOnline.h.

◆ fPauseHandler

TransitionHandler TMidasOnline::fPauseHandler

Definition at line 62 of file TMidasOnline.h.

◆ fResumeHandler

TransitionHandler TMidasOnline::fResumeHandler

Definition at line 63 of file TMidasOnline.h.

◆ fStartHandler

TransitionHandler TMidasOnline::fStartHandler

Definition at line 60 of file TMidasOnline.h.

◆ fStopHandler

TransitionHandler TMidasOnline::fStopHandler

Definition at line 61 of file TMidasOnline.h.

◆ gfMidas

TMidasOnline * TMidasOnline::gfMidas = NULL
staticprivate

TMidasOnline is a singleton class: only one instance is allowed at any time

Definition at line 73 of file TMidasOnline.h.


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