CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

smproxy::EventMsg Class Reference

#include <EventMsg.h>

List of all members.

Public Member Functions

unsigned char * dataLocation () const
bool empty () const
 EventMsg (const EventMsgView &)
 EventMsg ()
bool faulty () const
const stor::QueueIDsgetEventConsumerTags () 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< EventMsgBufferbuf_
bool faulty_
stor::QueueIDs queueIDs_

Detailed Description

A class for storing an EventMsgView and providing the basic APIs required for SMPS

Author:
mommsen
Revision:
1.1.4.2
Date:
2011/03/07 12:01:12

Definition at line 24 of file EventMsg.h.


Member Typedef Documentation

typedef std::vector<unsigned char> smproxy::EventMsg::EventMsgBuffer [private]

Definition at line 68 of file EventMsg.h.


Constructor & Destructor Documentation

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]
    );
  }

Member Function Documentation

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();
  }

Member Data Documentation

boost::shared_ptr<EventMsgBuffer> smproxy::EventMsg::buf_ [private]

Definition at line 69 of file EventMsg.h.

Referenced by empty(), EventMsg(), memoryUsed(), and totalDataSize().

Definition at line 70 of file EventMsg.h.

Referenced by faulty().

Definition at line 72 of file EventMsg.h.

Referenced by getEventConsumerTags(), and tagForEventConsumers().