![]() |
![]() |
#include <EventMsg.h>
Public Member Functions | |
unsigned char * | dataLocation () const |
bool | empty () const |
EventMsg (const EventMsgView &) | |
EventMsg () | |
bool | faulty () const |
const stor::QueueIDs & | getEventConsumerTags () const |
size_t | memoryUsed () const |
void | tagForEventConsumers (const stor::QueueIDs &) |
unsigned long | totalDataSize () const |
Private Types | |
typedef std::vector< unsigned char > | EventMsgBuffer |
Private Attributes | |
boost::shared_ptr< EventMsgBuffer > | buf_ |
bool | faulty_ |
stor::QueueIDs | queueIDs_ |
A class for storing an EventMsgView and providing the basic APIs required for SMPS
Definition at line 24 of file EventMsg.h.
typedef std::vector<unsigned char> smproxy::EventMsg::EventMsgBuffer [private] |
Definition at line 68 of file EventMsg.h.
smproxy::EventMsg::EventMsg | ( | ) |
Definition at line 10 of file EventMsg.cc.
: faulty_(true) {}
smproxy::EventMsg::EventMsg | ( | const EventMsgView & | eventMsgView | ) |
Definition at line 15 of file EventMsg.cc.
References buf_, filterCSVwithJSON::copy, EventMsgView::size(), and EventMsgView::startAddress().
: faulty_(false) { buf_.reset( new EventMsgBuffer(eventMsgView.size()) ); std::copy( eventMsgView.startAddress(), eventMsgView.startAddress()+eventMsgView.size(), &(*buf_)[0] ); }
unsigned char * smproxy::EventMsg::dataLocation | ( | ) | const |
Returns the start adderess of the event message
Definition at line 51 of file EventMsg.cc.
{
return &(*buf_)[0];
}
bool smproxy::EventMsg::empty | ( | void | ) | const |
Returns true if no event message is managed by *this
Definition at line 57 of file EventMsg.cc.
References buf_.
{ return (buf_.get() == 0); }
bool smproxy::EventMsg::faulty | ( | ) | const |
Returns true if the event message is faulty
Definition at line 63 of file EventMsg.cc.
References faulty_.
{ return faulty_; }
const stor::QueueIDs & smproxy::EventMsg::getEventConsumerTags | ( | ) | const |
Return the QueueIDs for which the event is tagged
Definition at line 33 of file EventMsg.cc.
References queueIDs_.
{ return queueIDs_; }
size_t smproxy::EventMsg::memoryUsed | ( | ) | const |
Returns the total memory occupied by the event message
Definition at line 39 of file EventMsg.cc.
References buf_.
{ return sizeof(buf_); }
void smproxy::EventMsg::tagForEventConsumers | ( | const stor::QueueIDs & | queueIDs | ) |
Tag the event for the passed list of queueIDs
Definition at line 27 of file EventMsg.cc.
References queueIDs_.
{ queueIDs_ = queueIDs; }
unsigned long smproxy::EventMsg::totalDataSize | ( | ) | const |
Returns the size of the event message
Definition at line 45 of file EventMsg.cc.
References buf_.
{ return buf_->size(); }
boost::shared_ptr<EventMsgBuffer> smproxy::EventMsg::buf_ [private] |
Definition at line 69 of file EventMsg.h.
Referenced by empty(), EventMsg(), memoryUsed(), and totalDataSize().
bool smproxy::EventMsg::faulty_ [private] |
Definition at line 70 of file EventMsg.h.
Referenced by faulty().
stor::QueueIDs smproxy::EventMsg::queueIDs_ [private] |
Definition at line 72 of file EventMsg.h.
Referenced by getEventConsumerTags(), and tagForEventConsumers().