DABC (Data Acquisition Backbone Core)  2.9.9
Static Protected Member Functions | Private Member Functions | Static Private Member Functions
mbs::ReadoutHandle Class Reference

Handle to organize readout of MBS data source. More...

#include <mbs/api.h>

Inheritance diagram for mbs::ReadoutHandle:
dabc::ModuleAsyncRef dabc::ModuleRef dabc::WorkerRef dabc::Reference hadaq::ReadoutHandle

Static Protected Member Functions

static ReadoutHandle DoConnect (const std::string &url, const char *classname)
 

Private Member Functions

bool Disconnect ()
 Disconnect from MBS server. More...
 
mbs::EventHeaderGetEvent ()
 Get current event pointer. More...
 
mbs::EventHeaderNextEvent (double tmout=1.0, double maxage=-1.)
 Retrieve next event from the server One could specify timeout (how long one should wait for next event, default 1 s) and maximal age of the event on client side (default -1) Maximal age parameters allows to skip old events, analyzing only newest. More...
 
bool null () const
 Check if handle is initialized. More...
 

Static Private Member Functions

static ReadoutHandle Connect (const std::string &url)
 Connect with MBS server. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dabc::ModuleRef
bool CheckConnected ()
 
bool ConnectPoolHandles ()
 Method called by manager to establish connection to pools TODO: while used from devices, made public. More...
 
PortRef FindPort (const std::string &name)
 Return reference on the port. More...
 
std::string InfoParName () const
 Returns info parameter name, used to provide different kind of log/debug information. More...
 
std::string InputName (unsigned n=0, bool itemname=true)
 Return item name of the input, can be used in connect command. More...
 
bool IsInputConnected (unsigned ninp)
 Returns true if specified input is connected. More...
 
bool IsOutputConnected (unsigned ninp)
 Returns true if specified output is connected. More...
 
bool IsPortConnected (const std::string &name)
 Returns true if port with specified name is connected - thread safe. More...
 
bool IsRunning () const
 
unsigned NumInputs ()
 Returns number of inputs in the module. More...
 
unsigned NumOutputs ()
 Returns number of outputs in the module. More...
 
std::string OutputName (unsigned n=0, bool itemname=true)
 Return item name of the output, can be used in connect command. More...
 
bool Start ()
 
bool Stop ()
 
- Protected Member Functions inherited from dabc::WorkerRef
bool CanSubmitCommand () const
 Returns true if command can be submitted to the worker. More...
 
RecordField Cfg (const std::string &name, Command cmd=nullptr) const
 Returns configuration record of specified name. More...
 
bool Execute (Command cmd, double tmout=-1.)
 
bool Execute (const std::string &cmd, double tmout=-1.)
 
bool FireEvent (const EventId &ev)
 
bool FireEvent (uint16_t evid, uint32_t arg)
 
bool HasThread () const
 Returns true when thread is assigned to the worker. More...
 
bool IsSameThread (const WorkerRef &ref)
 Returns true if two workers share same thread. More...
 
bool MakeThreadForWorker (const std::string &thrdname="")
 
Parameter Par (const std::string &name) const
 Returns reference on parameter. More...
 
bool Submit (Command cmd)
 
bool SyncWorker (double tmout=-1.)
 Synchronize worker with caller thread. More...
 
ThreadRef thread ()
 
std::string ThreadName () const
 Returns thread name of worker assigned. More...
 
- Protected Member Functions inherited from dabc::Reference
bool AcquireRefWithoutMutex (Reference &ref)
 Special method, which allows to generate new reference when object mutex is locked. More...
 
void Assign (const Reference &src)
 Method used in copy constructor and assigned operations. More...
 
MutexObjectMutex () const
 
template<class T >
bool verify_object (Object *src, T *&tgt)
 Method used in reference constructor/assignments to verify is object is suitable. More...
 
bool AddChild (Object *obj)
 Add child to list of object children. More...
 
const char * ClassName () const
 Return class name of referenced object, if object not assigned, returns "---". More...
 
void Destroy () throw ()
 Release reference and starts destroyment of referenced object. More...
 
Reference FindChild (const char *name) const
 Searches for child in referenced object. More...
 
bool GetAllChildRef (ReferencesVector *vect) const
 Return references for all childs. More...
 
Reference GetChild (unsigned n) const
 Return reference on child n. More...
 
Reference GetFolder (const std::string &name, bool force=false) throw ()
 Return folder of specified name, no special symbols are allowed. More...
 
const char * GetName () const
 Return name of referenced object, if object not assigned, returns "---". More...
 
ObjectGetObject () const
 Return pointer on the object. More...
 
ObjectGetParent () const
 Returns pointer on parent object. More...
 
Reference GetParentRef () const
 Returns reference on parent object. More...
 
bool IsName (const char *name) const
 Returns true if object name is the same as specified one. More...
 
std::string ItemName (bool compact=true) const
 Produce string, which can be used as name argument in dabc::mgr.FindItem(name) call. More...
 
bool null () const
 Returns true if reference contains nullptr. More...
 
unsigned NumChilds () const
 Return number of childs in referenced object. More...
 
unsigned NumReferences () const
 Returns number of references on the object. More...
 
bool operator! () const
 Returns true if reference contains nullptr. More...
 
bool operator!= (const Reference &src) const
 Compare operator - return true if references refer to different object. More...
 
bool operator!= (Object *obj) const
 Compare operator - return true if reference refer to different objects. More...
 
Objectoperator() () const
 Return pointer on the object. More...
 
Referenceoperator<< (Reference &src) throw ()
 Move operator - reference moved from source to target. More...
 
Referenceoperator= (const Reference &src) throw ()
 Assignment operator - copy reference. More...
 
Referenceoperator= (Object *obj) throw ()
 Assignment operator - copy reference. More...
 
bool operator== (const Reference &src) const
 Compare operator - return true if references refer to same object. More...
 
bool operator== (Object *obj) const
 Compare operator - return true if reference refer to same object. More...
 
void Print (int lvl=0, const char *from=0) const
 Show on debug output content of reference. More...
 
 Reference (const Reference &src) throw ()
 Copy constructor, if source is transient than source reference will be emptied. More...
 
 Reference (Object *obj=nullptr)
 Constructor, creates reference on the object. More...
 
std::string RelativeName (const dabc::Reference &topitem)
 Produce name, which can be used to find item, calling topitem.FindChild(). More...
 
void Release () throw ()
 Releases reference on the object. More...
 
bool RemoveChild (const char *name, bool cleanup=true)
 Remove child with given name and return reference on that child. More...
 
bool RemoveChilds (bool cleanup=true)
 Remove all childs in referenced object If cleanup true (default) and object is owner, all objects will be destroyed. More...
 
void SetAutoDestroy (bool on=true)
 Set autodestroy flag for the object Once enabled, object will be destroyed when last reference will be cleared. More...
 
void SetObject (Object *obj, bool withmutex=true)
 Direct set of object to reference. More...
 
Reference Take ()
 Copy reference to output object. More...
 
virtual ~Reference ()
 Destructor, releases reference on the object. More...
 
- Protected Attributes inherited from dabc::Reference
ObjectfObj
 pointer on the object More...
 

Detailed Description

Handle to organize readout of MBS data source.

Definition at line 74 of file api.h.

Member Function Documentation

◆ Connect()

static ReadoutHandle mbs::ReadoutHandle::Connect ( const std::string &  url)
inlinestaticprivate

Connect with MBS server.

Definition at line 79 of file api.h.

◆ null()

bool mbs::ReadoutHandle::null ( ) const
inlineprivate

Check if handle is initialized.

Definition at line 85 of file api.h.

◆ Disconnect()

bool mbs::ReadoutHandle::Disconnect ( )
private

Disconnect from MBS server.

Definition at line 171 of file api.cxx.

◆ NextEvent()

mbs::EventHeader * mbs::ReadoutHandle::NextEvent ( double  tmout = 1.0,
double  maxage = -1. 
)
private

Retrieve next event from the server One could specify timeout (how long one should wait for next event, default 1 s) and maximal age of the event on client side (default -1) Maximal age parameters allows to skip old events, analyzing only newest.

Definition at line 190 of file api.cxx.

◆ GetEvent()

mbs::EventHeader * mbs::ReadoutHandle::GetEvent ( )
private

Get current event pointer.

Definition at line 211 of file api.cxx.

◆ DoConnect()

mbs::ReadoutHandle mbs::ReadoutHandle::DoConnect ( const std::string &  url,
const char *  classname 
)
staticprotected

Definition at line 136 of file api.cxx.


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