Project
Loading...
Searching...
No Matches
o2::framework::DriverClient Class Referenceabstract

A service API to communicate with the driver. More...

#include <DriverClient.h>

Inherited by o2::framework::TextDriverClient, and o2::framework::WSDriverClient.

Public Member Functions

virtual void tell (char const *msg, size_t s, bool flush=true)=0
 
void tell (std::string_view const &msg, bool flush=true)
 
void observe (char const *eventType, std::function< void(std::string_view)> callback)
 Request action on some eventType notified by the driver.
 
void dispatch (std::string_view event)
 Dispatch an event.
 
virtual void flushPending (ServiceRegistryRef mainThreadRef)=0
 

Static Public Attributes

static constexpr ServiceKind service_kind = ServiceKind::Global
 

Detailed Description

A service API to communicate with the driver.

Definition at line 30 of file DriverClient.h.

Member Function Documentation

◆ dispatch()

void o2::framework::DriverClient::dispatch ( std::string_view  event)

Dispatch an event.

Definition at line 23 of file DriverClient.cxx.

◆ flushPending()

virtual void o2::framework::DriverClient::flushPending ( ServiceRegistryRef  mainThreadRef)
pure virtual

Flush all pending events (if connected) Note: this must be guaranteed to be called from the main thread, because the libuv backend cannot queue write operations on a thread which is not the main one. In order to do this, one should have assert(mainTreadRef.isMainThread()) in the implementation. Notice also that if you want to use uv_async_send, you must make sure that you do not rely on having as many events as the times you called uv_async_send, because this is not guaranteed.

Implemented in o2::framework::WSDriverClient, and o2::framework::TextDriverClient.

◆ observe()

void o2::framework::DriverClient::observe ( char const *  eventType,
std::function< void(std::string_view)>  callback 
)

Request action on some eventType notified by the driver.

Definition at line 18 of file DriverClient.cxx.

◆ tell() [1/2]

virtual void o2::framework::DriverClient::tell ( char const *  msg,
size_t  s,
bool  flush = true 
)
pure virtual

Report some message to the Driver msg the message to be sent. size size of the message to be sent. flush whether the message should be flushed immediately, if possible.

Implemented in o2::framework::TextDriverClient, and o2::framework::WSDriverClient.

◆ tell() [2/2]

void o2::framework::DriverClient::tell ( std::string_view const &  msg,
bool  flush = true 
)
inline

Definition at line 41 of file DriverClient.h.

Member Data Documentation

◆ service_kind

constexpr ServiceKind o2::framework::DriverClient::service_kind = ServiceKind::Global
staticconstexpr

Definition at line 33 of file DriverClient.h.


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