#include <SlaveQueue.h>
Public Member Functions | |
int | id () const |
int | post (MsgBuf &ptr) |
unsigned long | rcv (MsgBuf &ptr) |
unsigned long | rcvNonBlocking (MsgBuf &ptr) |
unsigned long | rcvNonBlockingAny (MsgBuf &ptr) |
SlaveQueue (unsigned int ind) | |
~SlaveQueue () | |
Private Attributes | |
int | queue_id_ |
Definition at line 18 of file SlaveQueue.h.
evf::SlaveQueue::SlaveQueue | ( | unsigned int | ind | ) | [inline] |
Definition at line 22 of file SlaveQueue.h.
References QUEUE_ID, and queue_id_.
: queue_id_(0) { /* get an (existing) public message queue */ queue_id_ = msgget(QUEUE_ID+ind, 0); if (queue_id_ == -1) { XCEPT_RAISE(evf::Exception, "failed to get message queue"); } }
evf::SlaveQueue::~SlaveQueue | ( | ) | [inline] |
Definition at line 31 of file SlaveQueue.h.
{ }
int evf::SlaveQueue::id | ( | void | ) | const [inline] |
int evf::SlaveQueue::post | ( | MsgBuf & | ptr | ) | [inline] |
Definition at line 35 of file SlaveQueue.h.
References gather_cfg::cout, evf::MsgBuf::msize(), evf::MsgBuf::ptr_, and queue_id_.
Referenced by evf::Vulture::control(), and evf::SubProcess::postSlave().
unsigned long evf::SlaveQueue::rcv | ( | MsgBuf & | ptr | ) | [inline] |
Definition at line 45 of file SlaveQueue.h.
References MSGQ_MESSAGE_TYPE_RANGE, evf::MsgBuf::msize(), MSQS_MESSAGE_TYPE_SLA, evf::MsgBuf::ptr_, and queue_id_.
Referenced by evf::Vulture::control(), and evf::SubProcess::rcvSlave().
{ unsigned long msg_type = MSQS_MESSAGE_TYPE_SLA; int rc = msgrcv(queue_id_, ptr.ptr_, ptr.msize(), - msg_type, 0); if (rc == -1 && errno != ENOMSG) { std::string serr = "rcv::Slave failed to get message from queue - error:"; serr += strerror(errno); XCEPT_RAISE(evf::Exception, serr); } else if(rc == -1 && errno == ENOMSG) return MSGQ_MESSAGE_TYPE_RANGE; return msg_type; }
unsigned long evf::SlaveQueue::rcvNonBlocking | ( | MsgBuf & | ptr | ) | [inline] |
Definition at line 58 of file SlaveQueue.h.
References MSGQ_MESSAGE_TYPE_RANGE, evf::MsgBuf::msize(), MSQS_MESSAGE_TYPE_SLA, evf::MsgBuf::ptr_, and queue_id_.
Referenced by evf::SubProcess::rcvSlaveNonBlocking().
{ unsigned long msg_type = MSQS_MESSAGE_TYPE_SLA; int rc = msgrcv(queue_id_, ptr.ptr_, ptr.msize(), - msg_type, IPC_NOWAIT); if (rc == -1 && errno != ENOMSG) { std::string serr = "rcvnb::Slave failed to get message from queue - error:"; serr += strerror(errno); XCEPT_RAISE(evf::Exception, serr); } else if(rc == -1 && errno == ENOMSG) return MSGQ_MESSAGE_TYPE_RANGE; return msg_type; }
unsigned long evf::SlaveQueue::rcvNonBlockingAny | ( | MsgBuf & | ptr | ) | [inline] |
Definition at line 71 of file SlaveQueue.h.
References MSGQ_MESSAGE_TYPE_RANGE, evf::MsgBuf::msize(), evf::MsgBuf::ptr_, and queue_id_.
{ unsigned long msg_type = 0; int rc = msgrcv(queue_id_, ptr.ptr_, ptr.msize(), msg_type, IPC_NOWAIT); if (rc == -1 && errno != ENOMSG) { std::string serr = "rcvnb::Slave failed to get message from queue - error:"; serr += strerror(errno); XCEPT_RAISE(evf::Exception, serr); } else if(rc == -1 && errno == ENOMSG) return MSGQ_MESSAGE_TYPE_RANGE; return msg_type; }
int evf::SlaveQueue::queue_id_ [private] |
Definition at line 87 of file SlaveQueue.h.
Referenced by id(), post(), rcv(), rcvNonBlocking(), rcvNonBlockingAny(), and SlaveQueue().