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
unsigned int droppedEventsCount () const
bool empty () const
 EventMsg ()
 EventMsg (const EventMsgView &)
bool faulty () const
const stor::QueueIDsgetEventConsumerTags () const
size_t memoryUsed () const
void setDroppedEventsCount (unsigned int count)
void tagForEventConsumers (const stor::QueueIDs &)
unsigned long totalDataSize () const

Private Types

typedef std::vector< unsigned
char > 
EventMsgBuffer

Private Attributes

boost::shared_ptr< EventMsgBufferbuf_
unsigned int droppedEventsCount_
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.3
Date:
2011/03/08 18:44:55

Definition at line 24 of file EventMsg.h.


Member Typedef Documentation

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

Definition at line 78 of file EventMsg.h.


Constructor & Destructor Documentation

smproxy::EventMsg::EventMsg ( )

Definition at line 10 of file EventMsg.cc.

                     :
  faulty_(true),
  droppedEventsCount_(0)
  {}
smproxy::EventMsg::EventMsg ( const EventMsgView eventMsgView)

Definition at line 16 of file EventMsg.cc.

References buf_, filterCSVwithJSON::copy, EventMsgView::droppedEventsCount(), droppedEventsCount_, EventMsgView::size(), and EventMsgView::startAddress().

                                                     :
  faulty_(false)
  {
    buf_.reset( new EventMsgBuffer(eventMsgView.size()) );
    std::copy(
      eventMsgView.startAddress(),
      eventMsgView.startAddress()+eventMsgView.size(),
      &(*buf_)[0]
    );
    droppedEventsCount_ = eventMsgView.droppedEventsCount();
  }

Member Function Documentation

unsigned char * smproxy::EventMsg::dataLocation ( ) const

Returns the start adderess of the event message

Definition at line 66 of file EventMsg.cc.

Referenced by setDroppedEventsCount(), and stor::ConsumerUtils< Configuration_t, EventQueueCollection_t >::writeConsumerEvent().

  {
    return &(*buf_)[0];
  }
unsigned int smproxy::EventMsg::droppedEventsCount ( ) const

Return the number of dropped events found in the EventHeader

Definition at line 41 of file EventMsg.cc.

References droppedEventsCount_.

  {
    return droppedEventsCount_;
  }
bool smproxy::EventMsg::empty ( void  ) const

Returns true if no event message is managed by *this

Definition at line 72 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 78 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 35 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 54 of file EventMsg.cc.

References buf_.

  {
    return sizeof(buf_);
  }
void smproxy::EventMsg::setDroppedEventsCount ( unsigned int  count)

Add the number of dropped events to the number found in the EventHeader

Definition at line 47 of file EventMsg.cc.

References lhef::cc::convert(), dataLocation(), and EventHeader::droppedEventsCount_.

void smproxy::EventMsg::tagForEventConsumers ( const stor::QueueIDs queueIDs)

Tag the event for the passed list of queueIDs

Definition at line 29 of file EventMsg.cc.

References queueIDs_.

  {
    queueIDs_ = queueIDs;
  }
unsigned long smproxy::EventMsg::totalDataSize ( ) const

Returns the size of the event message

Definition at line 60 of file EventMsg.cc.

References buf_.

Referenced by stor::ConsumerUtils< Configuration_t, EventQueueCollection_t >::writeConsumerEvent().

  {
    return buf_->size();
  }

Member Data Documentation

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

Definition at line 79 of file EventMsg.h.

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

Definition at line 81 of file EventMsg.h.

Referenced by droppedEventsCount(), and EventMsg().

Definition at line 80 of file EventMsg.h.

Referenced by faulty().

Definition at line 83 of file EventMsg.h.

Referenced by getEventConsumerTags(), and tagForEventConsumers().