UNIVERS
15.3
UNIVERS base processing software API
|
#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 |
IPC queue messages manager
typedef std::vector<dcf::IPCMsgMan::Message> dcf::IPCMsgMan::Messages |
Vector of messages
dcf::IPCMsgMan::IPCMsgMan | ( | ) |
Default constructor. Tries to create new queue if it has not created.
|
virtual |
Removes queue if it is empty.
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.
|
protected |
Returns id of new or created queue or -1 if queue can't be created.
|
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.