13#error This is a C++ include file and cannot be used from plain C
30#define ngcdcsSHM_NAME_DEFAULT "NGC"
35#define ngcdcsSHM_NUM_BUF 2
65 ngcdcsSHM(FILE *wd,
const char *s,
int n);
83 void *
Buffer(
int noWait=1);
110 virtual void *
Alloc(
size_t size);
116 virtual int SetName(
const char *newName);
133 if (flag) initialized_ = 1;
134 else initialized_ = 0;
int NumBuf()
Return number of buffers.
Definition ngcdcsSHM.hpp:80
virtual int BufferTryLock(int idx)
Try to lock buffer[idx].
Definition ngcdcsSHM.cpp:497
void ** buffer
Pointers to shared memory buffers.
Definition ngcdcsSHM.hpp:123
virtual void BufferWait(int idx)
Wait for buffer[idx].
Definition ngcdcsSHM.cpp:480
size_t bufferSize
Buffer size.
Definition ngcdcsSHM.hpp:126
ngcdcsSHM()
Constructor.
Definition ngcdcsSHM.cpp:30
void * spare
Spare buffer.
Definition ngcdcsSHM.hpp:50
virtual int Publish(int idx, const ngcdcs_finfo_t &finfo, int endian, int fullFrame)
Publish buffer.
Definition ngcdcsSHM.cpp:503
virtual int BufferLocked(int idx)
Check if buffer[idx] is locked.
Definition ngcdcsSHM.cpp:485
int TryWait()
Return zero when current buffer is not locked.
Definition ngcdcsSHM.cpp:334
virtual int SetName(const char *newName)
Set new interface name.
Definition ngcdcsSHM.cpp:474
char type[64]
Interface type.
Definition ngcdcsSHM.hpp:47
char * ErrMsg()
Error message.
Definition ngcdcsSHM.hpp:74
int Initialized()
Check if initialization was OK.
Definition ngcdcsSHM.hpp:71
virtual void BufferUnlock(int idx)
Unlock buffer.
Definition ngcdcsSHM.hpp:159
void Wait()
Wait until current buffer is unlocked.
Definition ngcdcsSHM.cpp:309
void Initialized(int flag)
Set initialization flag.
Definition ngcdcsSHM.hpp:132
char thisHost[46]
This host.
Definition ngcdcsSHM.hpp:129
void Reset()
Reset buffer index.
Definition ngcdcsSHM.hpp:138
virtual void * Alloc(size_t size)
Allocate shared memory area.
Definition ngcdcsSHM.cpp:397
int Export(const ngcdcs_finfo_t &finfo, int endian)
Update the current buffer and switch to the next item.
Definition ngcdcsSHM.cpp:291
void Unlock(int noWait)
Unlock resources.
Definition ngcdcsSHM.cpp:320
int Update(const ngcdcs_finfo_t &finfo, int endian, int fullFrame=0)
Update the current buffer.
Definition ngcdcsSHM.cpp:263
char name[64]
Interface name for attachment.
Definition ngcdcsSHM.hpp:44
void * Buffer(int noWait=1)
Get pointer to current buffer.
Definition ngcdcsSHM.cpp:221
int LockNext(int noWait=1)
Lock next buffer.
Definition ngcdcsSHM.cpp:366
virtual ~ngcdcsSHM()
Definition ngcdcsSHM.cpp:81
void InvalidateBuffers()
Invalidate buffers.
Definition ngcdcsSHM.hpp:141
virtual void Free()
Release allocated resources.
Definition ngcdcsSHM.cpp:447
void Next()
Switch to the next buffer.
Definition ngcdcsSHM.cpp:285
virtual void InvalidateEvent()
Invalidate last event.
Definition ngcdcsSHM.hpp:144
int Locked()
Check if next buffer is locked.
Definition ngcdcsSHM.cpp:350
virtual int BufferLock(int idx)
Lock buffer[idx].
Definition ngcdcsSHM.cpp:491
FILE * watchdog
Watchdog stream.
Definition ngcdcsSHM.hpp:120
Definition ngcdcsFINFO.hpp:468