lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
psalg::shmem::XtcMonitorMsg Class Reference

Record of four 32-bit words: a buffer index; a packed word with the number of buffers (bits 7:0), number of queues (bits 15:8) and return queue (bits 23:16); a size word (bits 27:0 used); and a reserved word. More...

#include <XtcMonitorMsg.hh>

Public Member Functions

 XtcMonitorMsg ()
 Set all fields to 0.
 
 XtcMonitorMsg (int bufferIndex)
 Set the buffer index to bufferIndex and all other fields to 0.
 
 ~XtcMonitorMsg ()
 Destructor; does nothing.
 
int bufferIndex () const
 Return the buffer index.
 
int numberOfBuffers () const
 Return bits 7:0 of the packed word.
 
int numberOfQueues () const
 Return bits 15:8 of the packed word.
 
size_t sizeOfBuffers () const
 Return the size word masked with SizeMask (bits 27:0).
 
bool serial () const
 Return true if return_queue() is 0.
 
int return_queue () const
 Return bits 23:16 of the packed word.
 
XtcMonitorMsg * bufferIndex (int b)
 Set the buffer index to b and return this.
 
void numberOfBuffers (int n)
 Set bits 7:0 of the packed word to n & 0xff.
 
void numberOfQueues (int n)
 Set bits 15:8 of the packed word to n & 0xff.
 
void sizeOfBuffers (int s)
 Set bits 27:0 of the size word to s & SizeMask, keeping bits 31:28.
 
void return_queue (int q)
 Set bits 23:16 of the packed word to q & 0xff.
 

Static Public Member Functions

static void sharedMemoryName (const char *tag, char *buffer)
 Write "/PdsMonitorSharedMemory_" + tag into buffer with sprintf (no length check).
 
static void eventInputQueue (const char *tag, unsigned client, char *buffer)
 Write "/PdsToMonitorEvQueue_" + tag + "_" + client into buffer with sprintf (no length check).
 
static void eventOutputQueue (const char *tag, unsigned client, char *buffer)
 Write "/PdsToMonitorEvQueue_" + tag + "_" + (client+1) into buffer with sprintf, i.e.
 
static void transitionInputQueue (const char *tag, unsigned client, char *buffer)
 Write "/PdsToMonitorTrQueue_" + tag + "_" + client into buffer with sprintf (no length check).
 
static void discoveryQueue (const char *tag, char *buffer)
 Write "/PdsFromMonitorDiscovery_" + tag into buffer with sprintf (no length check).
 
static void registerQueue (const char *tag, char *buffer, int id)
 Write "/PdsToMonitorDiscovery_" + tag + "_" + id into buffer with sprintf (no length check).
 

Detailed Description

Record of four 32-bit words: a buffer index; a packed word with the number of buffers (bits 7:0), number of queues (bits 15:8) and return queue (bits 23:16); a size word (bits 27:0 used); and a reserved word.

Static helpers write the names of the shared memory and message queues for a tag.

Constructor & Destructor Documentation

◆ XtcMonitorMsg() [1/2]

psalg::shmem::XtcMonitorMsg::XtcMonitorMsg ( )
inline

Set all fields to 0.

◆ XtcMonitorMsg() [2/2]

psalg::shmem::XtcMonitorMsg::XtcMonitorMsg ( int  bufferIndex)
inline

Set the buffer index to bufferIndex and all other fields to 0.

◆ ~XtcMonitorMsg()

psalg::shmem::XtcMonitorMsg::~XtcMonitorMsg ( )
inline

Destructor; does nothing.

Member Function Documentation

◆ bufferIndex() [1/2]

int psalg::shmem::XtcMonitorMsg::bufferIndex ( ) const
inline

Return the buffer index.

◆ bufferIndex() [2/2]

XtcMonitorMsg * psalg::shmem::XtcMonitorMsg::bufferIndex ( int  b)
inline

Set the buffer index to b and return this.

◆ discoveryQueue()

static void psalg::shmem::XtcMonitorMsg::discoveryQueue ( const char *  tag,
char *  buffer 
)
static

Write "/PdsFromMonitorDiscovery_" + tag into buffer with sprintf (no length check).

◆ eventInputQueue()

static void psalg::shmem::XtcMonitorMsg::eventInputQueue ( const char *  tag,
unsigned  client,
char *  buffer 
)
static

Write "/PdsToMonitorEvQueue_" + tag + "_" + client into buffer with sprintf (no length check).

◆ eventOutputQueue()

static void psalg::shmem::XtcMonitorMsg::eventOutputQueue ( const char *  tag,
unsigned  client,
char *  buffer 
)
static

Write "/PdsToMonitorEvQueue_" + tag + "_" + (client+1) into buffer with sprintf, i.e.

the eventInputQueue() name of client+1.

◆ numberOfBuffers() [1/2]

int psalg::shmem::XtcMonitorMsg::numberOfBuffers ( ) const
inline

Return bits 7:0 of the packed word.

◆ numberOfBuffers() [2/2]

void psalg::shmem::XtcMonitorMsg::numberOfBuffers ( int  n)
inline

Set bits 7:0 of the packed word to n & 0xff.

◆ numberOfQueues() [1/2]

int psalg::shmem::XtcMonitorMsg::numberOfQueues ( ) const
inline

Return bits 15:8 of the packed word.

◆ numberOfQueues() [2/2]

void psalg::shmem::XtcMonitorMsg::numberOfQueues ( int  n)
inline

Set bits 15:8 of the packed word to n & 0xff.

◆ registerQueue()

static void psalg::shmem::XtcMonitorMsg::registerQueue ( const char *  tag,
char *  buffer,
int  id 
)
static

Write "/PdsToMonitorDiscovery_" + tag + "_" + id into buffer with sprintf (no length check).

◆ return_queue() [1/2]

int psalg::shmem::XtcMonitorMsg::return_queue ( ) const
inline

Return bits 23:16 of the packed word.

◆ return_queue() [2/2]

void psalg::shmem::XtcMonitorMsg::return_queue ( int  q)
inline

Set bits 23:16 of the packed word to q & 0xff.

◆ serial()

bool psalg::shmem::XtcMonitorMsg::serial ( ) const
inline

Return true if return_queue() is 0.

◆ sharedMemoryName()

static void psalg::shmem::XtcMonitorMsg::sharedMemoryName ( const char *  tag,
char *  buffer 
)
static

Write "/PdsMonitorSharedMemory_" + tag into buffer with sprintf (no length check).

◆ sizeOfBuffers() [1/2]

size_t psalg::shmem::XtcMonitorMsg::sizeOfBuffers ( ) const
inline

Return the size word masked with SizeMask (bits 27:0).

◆ sizeOfBuffers() [2/2]

void psalg::shmem::XtcMonitorMsg::sizeOfBuffers ( int  s)
inline

Set bits 27:0 of the size word to s & SizeMask, keeping bits 31:28.

◆ transitionInputQueue()

static void psalg::shmem::XtcMonitorMsg::transitionInputQueue ( const char *  tag,
unsigned  client,
char *  buffer 
)
static

Write "/PdsToMonitorTrQueue_" + tag + "_" + client into buffer with sprintf (no length check).


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