CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
smproxy::EventMsg Class Reference

#include <EventMsg.h>

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.1.2.7
Date:
2011/03/08 18:34:19

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.

10  :
11  faulty_(true),
13  {}
unsigned int droppedEventsCount_
Definition: EventMsg.h:81
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().

16  :
17  faulty_(false)
18  {
19  buf_.reset( new EventMsgBuffer(eventMsgView.size()) );
20  std::copy(
21  eventMsgView.startAddress(),
22  eventMsgView.startAddress()+eventMsgView.size(),
23  &(*buf_)[0]
24  );
25  droppedEventsCount_ = eventMsgView.droppedEventsCount();
26  }
uint8 * startAddress() const
Definition: EventMessage.h:79
std::vector< unsigned char > EventMsgBuffer
Definition: EventMsg.h:78
boost::shared_ptr< EventMsgBuffer > buf_
Definition: EventMsg.h:79
unsigned int droppedEventsCount_
Definition: EventMsg.h:81
uint32 droppedEventsCount() const
uint32 size() const
Definition: EventMessage.h:76

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().

67  {
68  return &(*buf_)[0];
69  }
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_.

42  {
43  return droppedEventsCount_;
44  }
unsigned int droppedEventsCount_
Definition: EventMsg.h:81
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_.

Referenced by python.Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and python.Vispa.Gui.VispaWidget.TextField::setAutotruncate().

73  {
74  return (buf_.get() == 0);
75  }
boost::shared_ptr< EventMsgBuffer > buf_
Definition: EventMsg.h:79
bool smproxy::EventMsg::faulty ( ) const

Returns true if the event message is faulty

Definition at line 78 of file EventMsg.cc.

References faulty_.

79  {
80  return faulty_;
81  }
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_.

36  {
37  return queueIDs_;
38  }
stor::QueueIDs queueIDs_
Definition: EventMsg.h:83
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_.

55  {
56  return sizeof(buf_);
57  }
boost::shared_ptr< EventMsgBuffer > buf_
Definition: EventMsg.h:79
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 convert(), dataLocation(), and EventHeader::droppedEventsCount_.

48  {
49  EventHeader* header = (EventHeader*)dataLocation();
51  }
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:46
char_uint32 droppedEventsCount_
Definition: EventMessage.h:66
unsigned char * dataLocation() const
Definition: EventMsg.cc:66
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_.

30  {
31  queueIDs_ = queueIDs;
32  }
stor::QueueIDs queueIDs_
Definition: EventMsg.h:83
unsigned long smproxy::EventMsg::totalDataSize ( ) const

Returns the size of the event message

Definition at line 60 of file EventMsg.cc.

References buf_.

61  {
62  return buf_->size();
63  }
boost::shared_ptr< EventMsgBuffer > buf_
Definition: EventMsg.h:79

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().

unsigned int smproxy::EventMsg::droppedEventsCount_
private

Definition at line 81 of file EventMsg.h.

Referenced by droppedEventsCount(), and EventMsg().

bool smproxy::EventMsg::faulty_
private

Definition at line 80 of file EventMsg.h.

Referenced by faulty().

stor::QueueIDs smproxy::EventMsg::queueIDs_
private

Definition at line 83 of file EventMsg.h.

Referenced by getEventConsumerTags(), and tagForEventConsumers().