UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
dcf::IPCMsgMan Class Reference

#include <ipcmsg_man.hpp>

Classes

struct  IPCMessage
 
struct  Message
 

Public Types

typedef std::vector
< dcf::IPCMsgMan::Message
Messages
 

Public Member Functions

 IPCMsgMan ()
 
virtual ~IPCMsgMan ()
 
dcf::error_t getMessagesNum (size_t &recs_num) const
 
dcf::error_t getMessages (IPCMsgMan::Messages &recs) const
 
dcf::error_t addMessage (const IPCMsgMan::Message &rec_data) const
 
dcf::error_t rmMessage (const IPCMsgMan::Message &rec_data, size_t &del_recs_num, bool rm_all=true) const
 
dcf::error_t rmQueue () const
 
dcf::error_t lock () const
 
dcf::error_t unlock () const
 

Protected Member Functions

int get_queue () const
 
int get_or_create_queue () const
 
int rm_queue () const
 
int get_sem () const
 
int get_or_create_sem () const
 
int rm_sem () const
 

Detailed Description

IPC queue messages manager

Member Typedef Documentation

Vector of messages

Constructor & Destructor Documentation

dcf::IPCMsgMan::IPCMsgMan ( )

Default constructor. Tries to create new queue if it has not created.

virtual dcf::IPCMsgMan::~IPCMsgMan ( )
virtual

Removes queue if it is empty.

Member Function Documentation

dcf::error_t dcf::IPCMsgMan::addMessage ( const IPCMsgMan::Message rec_data) const
Adding one record with provided data to the IPC queue.

Returns ErrSuccess if all good.

int dcf::IPCMsgMan::get_or_create_queue ( ) const
protected

Returns id of new or created queue or -1 if queue can't be created.

int dcf::IPCMsgMan::get_queue ( ) const
protected

Returns id of created queue or -1 if queue has not created yet.

dcf::error_t dcf::IPCMsgMan::getMessages ( IPCMsgMan::Messages recs) const

Gets queue records, returns ErrSuccess if all good.

dcf::error_t dcf::IPCMsgMan::getMessagesNum ( size_t &  recs_num) const
Gets number of records in queue. If queue is undefined then number of 

records is 0. Returns ErrSuccess if all good.

dcf::error_t dcf::IPCMsgMan::lock ( ) const
Tries to lock queue and wait while it will be unlocked if it has been locked. 

Returns ErrSuccess if all good.

dcf::error_t dcf::IPCMsgMan::rmMessage ( const IPCMsgMan::Message rec_data,
size_t &  del_recs_num,
bool  rm_all = true 
) const
Removes record(s) with provided rec_data from queue. 

del_recs_num - number of deleted records. Returns ErrSuccess if all good.

dcf::error_t dcf::IPCMsgMan::rmQueue ( ) const
Force to remove queue if it is created. It is DANGER to call.

Returns ErrSuccess if all good.

dcf::error_t dcf::IPCMsgMan::unlock ( ) const

Unlocks queue if it has been locked. Returns ErrSuccess if all good.


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