12#error This is a C++ include file and cannot be used from plain C
29#define ngcdcsSHM_NAME_DEFAULT "NGC"
34#define ngcdcsSHM_NUM_BUF 2
64 ngcdcsSHM(FILE *wd,
const char *s,
int n);
82 void *
Buffer(
int noWait=1);
109 virtual void *
Alloc(
size_t size);
115 virtual int SetName(
const char *newName);
132 if (flag) initialized_ = 1;
133 else initialized_ = 0;
int NumBuf()
Return number of buffers.
Definition ngcdcsSHM.hpp:79
virtual int BufferTryLock(int idx)
Try to lock buffer[idx].
Definition ngcdcsSHM.cpp:496
void ** buffer
Pointers to shared memory buffers.
Definition ngcdcsSHM.hpp:122
virtual void BufferWait(int idx)
Wait for buffer[idx].
Definition ngcdcsSHM.cpp:479
size_t bufferSize
Buffer size.
Definition ngcdcsSHM.hpp:125
ngcdcsSHM()
Constructor.
Definition ngcdcsSHM.cpp:29
void * spare
Spare buffer.
Definition ngcdcsSHM.hpp:49
virtual int Publish(int idx, const ngcdcs_finfo_t &finfo, int endian, int fullFrame)
Publish buffer.
Definition ngcdcsSHM.cpp:502
virtual int BufferLocked(int idx)
Check if buffer[idx] is locked.
Definition ngcdcsSHM.cpp:484
int TryWait()
Return zero when current buffer is not locked.
Definition ngcdcsSHM.cpp:333
virtual int SetName(const char *newName)
Set new interface name.
Definition ngcdcsSHM.cpp:473
char type[64]
Interface type.
Definition ngcdcsSHM.hpp:46
char * ErrMsg()
Error message.
Definition ngcdcsSHM.hpp:73
int Initialized()
Check if initialization was OK.
Definition ngcdcsSHM.hpp:70
virtual void BufferUnlock(int idx)
Unlock buffer.
Definition ngcdcsSHM.hpp:158
void Wait()
Wait until current buffer is unlocked.
Definition ngcdcsSHM.cpp:308
void Initialized(int flag)
Set initialization flag.
Definition ngcdcsSHM.hpp:131
char thisHost[46]
This host.
Definition ngcdcsSHM.hpp:128
void Reset()
Reset buffer index.
Definition ngcdcsSHM.hpp:137
virtual void * Alloc(size_t size)
Allocate shared memory area.
Definition ngcdcsSHM.cpp:396
int Export(const ngcdcs_finfo_t &finfo, int endian)
Update the current buffer and switch to the next item.
Definition ngcdcsSHM.cpp:290
void Unlock(int noWait)
Unlock resources.
Definition ngcdcsSHM.cpp:319
int Update(const ngcdcs_finfo_t &finfo, int endian, int fullFrame=0)
Update the current buffer.
Definition ngcdcsSHM.cpp:262
char name[64]
Interface name for attachment.
Definition ngcdcsSHM.hpp:43
void * Buffer(int noWait=1)
Get pointer to current buffer.
Definition ngcdcsSHM.cpp:220
int LockNext(int noWait=1)
Lock next buffer.
Definition ngcdcsSHM.cpp:365
virtual ~ngcdcsSHM()
Definition ngcdcsSHM.cpp:80
void InvalidateBuffers()
Invalidate buffers.
Definition ngcdcsSHM.hpp:140
virtual void Free()
Release allocated resources.
Definition ngcdcsSHM.cpp:446
void Next()
Switch to the next buffer.
Definition ngcdcsSHM.cpp:284
virtual void InvalidateEvent()
Invalidate last event.
Definition ngcdcsSHM.hpp:143
int Locked()
Check if next buffer is locked.
Definition ngcdcsSHM.cpp:349
virtual int BufferLock(int idx)
Lock buffer[idx].
Definition ngcdcsSHM.cpp:490
FILE * watchdog
Watchdog stream.
Definition ngcdcsSHM.hpp:119
Definition ngcdcsFINFO.hpp:462