MiniballSort
Loading...
Searching...
No Matches
DataSpy Class Reference

#include <DataSpy.hh>

Public Member Functions

 DataSpy ()
 
 ~DataSpy ()
 
void Verbose (int opt)
 
int Open (int id)
 
int Close (int id)
 
int ReadWithSeq (int id, char *data, unsigned int length, int *seq)
 
int Read (int id, char *data, unsigned int length)
 

Public Attributes

key_t shmkey = SHM_KEY
 
void * shm_bufferarea [MAX_ID]
 
int shmid [MAX_ID]
 
BUFFER_HEADERbaseaddress
 
int number_of_buffers [MAX_ID]
 
int buffers_offset [MAX_ID]
 
int next_index [MAX_ID]
 
unsigned long long current_age [MAX_ID]
 
int verbose
 

Detailed Description

Definition at line 63 of file DataSpy.hh.

Constructor & Destructor Documentation

◆ DataSpy()

DataSpy::DataSpy ( )
inline

Definition at line 67 of file DataSpy.hh.

◆ ~DataSpy()

DataSpy::~DataSpy ( )
inline

Definition at line 68 of file DataSpy.hh.

Member Function Documentation

◆ Close()

int DataSpy::Close ( int id)

dataSpyClose close a connection to an the shared file for that id close the file return OK or ERROR

Definition at line 80 of file DataSpy.cc.

Referenced by monitor_run().

◆ Open()

int DataSpy::Open ( int id)

DataSpy.cc data access routines These functions can be used by user programs to access data blocks held in shared memory This version Mar 2003 J.Cresswell and V.Pucknell Major update Dec 2014 to support use of Posix shared memory and for general use within the MIDAS data acq infrastructure Edits by L. P. Gaffney to C++ -ify it, with help from D. Zemlianska - July 2022 dataSpyOpen make a connection to an the shared file for that id return OK or ERROR (0 or -1)

Definition at line 13 of file DataSpy.cc.

Referenced by monitor_run().

◆ Read()

int DataSpy::Read ( int id,
char * data,
unsigned int length )

DataSpy::Read get a block of data for that id as for DataSpy::ReadWithSeq, but ignoring the sequence numbering provided for compatibility with earlier version

Definition at line 186 of file DataSpy.cc.

Referenced by monitor_run().

◆ ReadWithSeq()

int DataSpy::ReadWithSeq ( int id,
char * data,
unsigned int length,
int * seq )

DataSpy::Read get a block of data for that field check that the id is valid and opened check that there is any data in the queue increment the queue read index return length of data block or ERROR length is in units of bytes

Definition at line 112 of file DataSpy.cc.

Referenced by Read().

◆ Verbose()

void DataSpy::Verbose ( int opt)
inline

Definition at line 70 of file DataSpy.hh.

Member Data Documentation

◆ baseaddress

BUFFER_HEADER* DataSpy::baseaddress

Definition at line 86 of file DataSpy.hh.

Referenced by Open(), and ReadWithSeq().

◆ buffers_offset

int DataSpy::buffers_offset[MAX_ID]

Definition at line 89 of file DataSpy.hh.

Referenced by Open(), and ReadWithSeq().

◆ current_age

unsigned long long DataSpy::current_age[MAX_ID]

Definition at line 91 of file DataSpy.hh.

Referenced by Open(), and ReadWithSeq().

◆ next_index

int DataSpy::next_index[MAX_ID]

Definition at line 90 of file DataSpy.hh.

Referenced by Open(), and ReadWithSeq().

◆ number_of_buffers

int DataSpy::number_of_buffers[MAX_ID]

Definition at line 88 of file DataSpy.hh.

Referenced by Open(), and ReadWithSeq().

◆ shm_bufferarea

void* DataSpy::shm_bufferarea[MAX_ID]

Definition at line 84 of file DataSpy.hh.

Referenced by Close(), Open(), and ReadWithSeq().

◆ shmid

int DataSpy::shmid[MAX_ID]

Definition at line 85 of file DataSpy.hh.

Referenced by Open().

◆ shmkey

key_t DataSpy::shmkey = SHM_KEY

Definition at line 81 of file DataSpy.hh.

Referenced by Open().

◆ verbose

int DataSpy::verbose

Definition at line 93 of file DataSpy.hh.

Referenced by ReadWithSeq(), and Verbose().


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