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

#include <ngcbSHM.hpp>

Inheritance diagram for ngcbSHM:
ngcbSHMTHR

Public Member Functions

 ngcbSHM ()
 Constructor.
 
 ngcbSHM (const char *s)
 Constructor with name.
 
virtual ~ngcbSHM ()
 Destructor.
 
int Initialized ()
 Check, if initialization was OK.
 
char * ErrMsg ()
 Error message.
 
int Fd ()
 Return event file descriptor.
 
int IntPipe ()
 Return internal pipe indicator.
 
int NumClient ()
 Return number of registered clients.
 
void Remove ()
 Remove shared memory event interface.
 
int WrInit (int semId)
 Initialize writer lock.
 
int WrLock (int semId)
 Writer lock.
 
int WrTryLock (int semId)
 Writer try-lock.
 
int WrUnlock (int semId)
 Writer unlock.
 
void RdWait (int semId)
 Wait until there are no more readers.
 
int RdCnt (int semId)
 Return number of readers.
 
void RdUnlock (int semId)
 Release read-lock.
 
void RdUnlock (ngcb_shmhdr_t &hdr)
 Release read-lock.
 
int ShmLock (int shmId, int noWait=0)
 Lock shared memory (reader)
 
void ShmNoUndo ()
 Disable reader-lock undo-function (use with care!)
 
int ShmUnlock (int shmId)
 Unlock shared memory (reader)
 
void * AttachBuffer (int shmId, void *hdr, int noWait=0)
 Attach buffer to shared memory and read-lock.
 
void * TryAttachBuffer (int shmId, void *hdr)
 Try to read-lock and then attach buffer to shared memory.
 
void DetachBuffer ()
 Detach buffer from shared memory and release read-lock.
 
unsigned int EvtCnt ()
 Return event counter.
 
unsigned int NextEvt ()
 Return next event.
 
int AttachEvt ()
 Attach to event handler.
 
int Wait (int noWait=0)
 Wait for next event.
 
int TryWait ()
 Try to wait for next event.
 
void * GetBuffer (void *hdr, int noWait=0)
 Wait for next event and return a read-locked buffer.
 
void * TryGetBuffer (void *hdr)
 Try to wait for next event then try to read-lock the buffer.
 
int GetHdr (void *hdr, int noWait=0)
 Wait for next event, acquire read-lock and fill the header.
 
int TryGetHdr (void *hdr)
 Try to wait for event, try to acquire read-lock, then fill the header.
 
int Send (int shmId)
 Send event.
 
int Release ()
 Release event.
 
void Invalidate ()
 Invalidate event.
 
int RecvEvt ()
 Receive event from internal pipe.
 
int SendAck ()
 Send event acknowledge to internal pipe.
 
void Thread ()
 Thread function overloading the thread base class.
 
- Public Member Functions inherited from ngcbSHMTHR
 ngcbSHMTHR ()
 Constructor.
 
virtual ~ngcbSHMTHR ()
 Destructor.
 

Public Attributes

char name [64]
 Interface name.
 
ngcb_shmhdr_tsharedHeader
 Shared event header.
 

Detailed Description

Shared memory i/o class

Constructor & Destructor Documentation

◆ ngcbSHM() [1/2]

ngcbSHM::ngcbSHM ( )
inline

Constructor.

◆ ngcbSHM() [2/2]

ngcbSHM::ngcbSHM ( const char * s)
inlineexplicit

Constructor with name.

◆ ~ngcbSHM()

virtual ngcbSHM::~ngcbSHM ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ AttachBuffer()

void * ngcbSHM::AttachBuffer ( int shmId,
void * hdr,
int noWait = 0 )
inline

Attach buffer to shared memory and read-lock.

◆ AttachEvt()

int ngcbSHM::AttachEvt ( )
inline

Attach to event handler.

◆ DetachBuffer()

void ngcbSHM::DetachBuffer ( )
inline

Detach buffer from shared memory and release read-lock.

◆ ErrMsg()

char * ngcbSHM::ErrMsg ( )
inline

Error message.

◆ EvtCnt()

unsigned int ngcbSHM::EvtCnt ( )
inline

Return event counter.

◆ Fd()

int ngcbSHM::Fd ( )
inline

Return event file descriptor.

◆ GetBuffer()

void * ngcbSHM::GetBuffer ( void * hdr,
int noWait = 0 )
inline

Wait for next event and return a read-locked buffer.

◆ GetHdr()

int ngcbSHM::GetHdr ( void * hdr,
int noWait = 0 )
inline

Wait for next event, acquire read-lock and fill the header.

◆ Initialized()

int ngcbSHM::Initialized ( )
inline

Check, if initialization was OK.

◆ IntPipe()

int ngcbSHM::IntPipe ( )
inline

Return internal pipe indicator.

◆ Invalidate()

void ngcbSHM::Invalidate ( )
inline

Invalidate event.

◆ NextEvt()

unsigned int ngcbSHM::NextEvt ( )
inline

Return next event.

◆ NumClient()

int ngcbSHM::NumClient ( )
inline

Return number of registered clients.

◆ RdCnt()

int ngcbSHM::RdCnt ( int semId)
inline

Return number of readers.

◆ RdUnlock() [1/2]

void ngcbSHM::RdUnlock ( int semId)
inline

Release read-lock.

◆ RdUnlock() [2/2]

void ngcbSHM::RdUnlock ( ngcb_shmhdr_t & hdr)
inline

Release read-lock.

◆ RdWait()

void ngcbSHM::RdWait ( int semId)
inline

Wait until there are no more readers.

◆ RecvEvt()

int ngcbSHM::RecvEvt ( )
inline

Receive event from internal pipe.

◆ Release()

int ngcbSHM::Release ( )
inline

Release event.

◆ Remove()

void ngcbSHM::Remove ( )
inline

Remove shared memory event interface.

◆ Send()

int ngcbSHM::Send ( int shmId)
inline

Send event.

◆ SendAck()

int ngcbSHM::SendAck ( )
inline

Send event acknowledge to internal pipe.

◆ ShmLock()

int ngcbSHM::ShmLock ( int shmId,
int noWait = 0 )
inline

Lock shared memory (reader)

◆ ShmNoUndo()

void ngcbSHM::ShmNoUndo ( )
inline

Disable reader-lock undo-function (use with care!)

◆ ShmUnlock()

int ngcbSHM::ShmUnlock ( int shmId)
inline

Unlock shared memory (reader)

◆ Thread()

void ngcbSHM::Thread ( )
inlinevirtual

Thread function overloading the thread base class.

Reimplemented from ngcbSHMTHR.

◆ TryAttachBuffer()

void * ngcbSHM::TryAttachBuffer ( int shmId,
void * hdr )
inline

Try to read-lock and then attach buffer to shared memory.

◆ TryGetBuffer()

void * ngcbSHM::TryGetBuffer ( void * hdr)
inline

Try to wait for next event then try to read-lock the buffer.

◆ TryGetHdr()

int ngcbSHM::TryGetHdr ( void * hdr)
inline

Try to wait for event, try to acquire read-lock, then fill the header.

◆ TryWait()

int ngcbSHM::TryWait ( )
inline

Try to wait for next event.

◆ Wait()

int ngcbSHM::Wait ( int noWait = 0)
inline

Wait for next event.

◆ WrInit()

int ngcbSHM::WrInit ( int semId)
inline

Initialize writer lock.

◆ WrLock()

int ngcbSHM::WrLock ( int semId)
inline

Writer lock.

◆ WrTryLock()

int ngcbSHM::WrTryLock ( int semId)
inline

Writer try-lock.

◆ WrUnlock()

int ngcbSHM::WrUnlock ( int semId)
inline

Writer unlock.

Member Data Documentation

◆ name

char ngcbSHM::name[64]

Interface name.

◆ sharedHeader

ngcb_shmhdr_t* ngcbSHM::sharedHeader

Shared event header.


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