ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsSHM_IPC Class Reference

#include <ngcdcsSHM_IPC.hpp>

Inheritance diagram for ngcdcsSHM_IPC:
ngcdcsSHM

Public Member Functions

 ngcdcsSHM_IPC ()
 Constructor.
 
 ngcdcsSHM_IPC (FILE *wd)
 Constructor with watchdog.
 
 ngcdcsSHM_IPC (FILE *wd, int n)
 Constructor with number of buffers.
 
 ngcdcsSHM_IPC (FILE *wd, const char *s)
 Constructor with name.
 
 ngcdcsSHM_IPC (FILE *wd, const char *s, int n)
 Constructor with name and number of buffers.
 
virtual ~ngcdcsSHM_IPC ()
 
void * Alloc (size_t size)
 Allocate shared memory area.
 
void Free ()
 Release allocated resources.
 
int SetName (const char *newName)
 Set new interface name.
 
- Public Member Functions inherited from ngcdcsSHM
 ngcdcsSHM ()
 Constructor.
 
 ngcdcsSHM (FILE *wd)
 Constructor with watchdog.
 
 ngcdcsSHM (FILE *wd, int n)
 Constructor with number of buffers.
 
 ngcdcsSHM (FILE *wd, const char *s)
 Constructor with name.
 
 ngcdcsSHM (FILE *wd, const char *s, int n)
 Constructor with name and number of buffers.
 
virtual ~ngcdcsSHM ()
 
int Initialized ()
 Check if initialization was OK.
 
char * ErrMsg ()
 Error message.
 
int NumBuf (int n)
 Set number of buffers.
 
int NumBuf ()
 Return number of buffers.
 
void * Buffer (int noWait=1)
 Get pointer to current buffer.
 
int Update (const ngcdcs_finfo_t &finfo, int endian, int fullFrame=0)
 Update the current buffer.
 
void Next ()
 Switch to the next buffer.
 
int Export (const ngcdcs_finfo_t &finfo, int endian)
 Update the current buffer and switch to the next item.
 
void Wait ()
 Wait until current buffer is unlocked.
 
int TryWait ()
 Return zero when current buffer is not locked.
 
int Locked ()
 Check if next buffer is locked.
 
int LockNext (int noWait=1)
 Lock next buffer.
 
void Unlock (int noWait)
 Unlock resources.
 

Protected Member Functions

void InvalidateEvent ()
 Invalidate last event.
 
void BufferWait (int idx)
 Wait for buffer[idx].
 
int BufferLocked (int idx)
 Check if buffer[idx] is locked.
 
int BufferLock (int idx)
 Lock buffer[idx].
 
int BufferTryLock (int idx)
 Try to lock buffer[idx].
 
void BufferUnlock (int idx)
 Unlock buffer.
 
int Publish (int idx, const ngcdcs_finfo_t &finfo, int endian, int fullFrame)
 Publish buffer.
 
- Protected Member Functions inherited from ngcdcsSHM
void Initialized (int flag)
 Set initialization flag.
 
void Reset ()
 Reset buffer index.
 
void InvalidateBuffers ()
 Invalidate buffers.
 

Additional Inherited Members

- Public Attributes inherited from ngcdcsSHM
char name [64]
 Interface name for attachment.
 
char type [64]
 Interface type.
 
void * spare
 Spare buffer.
 
- Protected Attributes inherited from ngcdcsSHM
FILE * watchdog
 Watchdog stream.
 
void ** buffer
 Pointers to shared memory buffers.
 
size_t bufferSize
 Buffer size.
 
char thisHost [46]
 This host.
 

Detailed Description

NGC System V IPC shared memory interface class

Constructor & Destructor Documentation

◆ ngcdcsSHM_IPC() [1/5]

ngcdcsSHM_IPC::ngcdcsSHM_IPC ( )

Constructor.

◆ ngcdcsSHM_IPC() [2/5]

ngcdcsSHM_IPC::ngcdcsSHM_IPC ( FILE * wd)
explicit

Constructor with watchdog.

◆ ngcdcsSHM_IPC() [3/5]

ngcdcsSHM_IPC::ngcdcsSHM_IPC ( FILE * wd,
int n )

Constructor with number of buffers.

◆ ngcdcsSHM_IPC() [4/5]

ngcdcsSHM_IPC::ngcdcsSHM_IPC ( FILE * wd,
const char * s )

Constructor with name.

◆ ngcdcsSHM_IPC() [5/5]

ngcdcsSHM_IPC::ngcdcsSHM_IPC ( FILE * wd,
const char * s,
int n )

Constructor with name and number of buffers.

◆ ~ngcdcsSHM_IPC()

ngcdcsSHM_IPC::~ngcdcsSHM_IPC ( )
virtual

Member Function Documentation

◆ Alloc()

void * ngcdcsSHM_IPC::Alloc ( size_t size)
virtual

Allocate shared memory area.

Reimplemented from ngcdcsSHM.

◆ BufferLock()

int ngcdcsSHM_IPC::BufferLock ( int idx)
protectedvirtual

Lock buffer[idx].

Reimplemented from ngcdcsSHM.

◆ BufferLocked()

int ngcdcsSHM_IPC::BufferLocked ( int idx)
protectedvirtual

Check if buffer[idx] is locked.

Reimplemented from ngcdcsSHM.

◆ BufferTryLock()

int ngcdcsSHM_IPC::BufferTryLock ( int idx)
protectedvirtual

Try to lock buffer[idx].

Reimplemented from ngcdcsSHM.

◆ BufferUnlock()

void ngcdcsSHM_IPC::BufferUnlock ( int idx)
protectedvirtual

Unlock buffer.

Reimplemented from ngcdcsSHM.

◆ BufferWait()

void ngcdcsSHM_IPC::BufferWait ( int idx)
protectedvirtual

Wait for buffer[idx].

Reimplemented from ngcdcsSHM.

◆ Free()

void ngcdcsSHM_IPC::Free ( )
virtual

Release allocated resources.

Reimplemented from ngcdcsSHM.

◆ InvalidateEvent()

void ngcdcsSHM_IPC::InvalidateEvent ( )
protectedvirtual

Invalidate last event.

Reimplemented from ngcdcsSHM.

◆ Publish()

int ngcdcsSHM_IPC::Publish ( int idx,
const ngcdcs_finfo_t & finfo,
int endian,
int fullFrame )
protectedvirtual

Publish buffer.

Reimplemented from ngcdcsSHM.

◆ SetName()

int ngcdcsSHM_IPC::SetName ( const char * newName)
virtual

Set new interface name.

Reimplemented from ngcdcsSHM.


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