CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventMsg.cc
Go to the documentation of this file.
1 // $Id: EventMsg.cc,v 1.3 2011/03/08 18:44:55 mommsen Exp $
3 
5 
6 
7 namespace smproxy
8 {
9 
11  faulty_(true),
12  droppedEventsCount_(0)
13  {}
14 
15 
16  EventMsg::EventMsg(const EventMsgView& eventMsgView) :
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  }
27 
28 
30  {
31  queueIDs_ = queueIDs;
32  }
33 
34 
36  {
37  return queueIDs_;
38  }
39 
40 
41  unsigned int EventMsg::droppedEventsCount() const
42  {
43  return droppedEventsCount_;
44  }
45 
46 
48  {
50  convert(count,header->droppedEventsCount_);
51  }
52 
53 
54  size_t EventMsg::memoryUsed() const
55  {
56  return sizeof(buf_);
57  }
58 
59 
60  unsigned long EventMsg::totalDataSize() const
61  {
62  return buf_->size();
63  }
64 
65 
66  unsigned char* EventMsg::dataLocation() const
67  {
68  return &(*buf_)[0];
69  }
70 
71 
72  bool EventMsg::empty() const
73  {
74  return (buf_.get() == 0);
75  }
76 
77 
78  bool EventMsg::faulty() const
79  {
80  return faulty_;
81  }
82 
83 } // namespace smproxy
84 
uint8 * startAddress() const
Definition: EventMessage.h:79
std::vector< QueueID > QueueIDs
Definition: QueueID.h:80
std::vector< unsigned char > EventMsgBuffer
Definition: EventMsg.h:78
size_t memoryUsed() const
Definition: EventMsg.cc:54
const stor::QueueIDs & getEventConsumerTags() const
Definition: EventMsg.cc:35
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:46
bool faulty() const
Definition: EventMsg.cc:78
boost::shared_ptr< EventMsgBuffer > buf_
Definition: EventMsg.h:79
stor::QueueIDs queueIDs_
Definition: EventMsg.h:83
unsigned int droppedEventsCount() const
Definition: EventMsg.cc:41
char_uint32 droppedEventsCount_
Definition: EventMessage.h:66
unsigned int droppedEventsCount_
Definition: EventMsg.h:81
void tagForEventConsumers(const stor::QueueIDs &)
Definition: EventMsg.cc:29
unsigned char * dataLocation() const
Definition: EventMsg.cc:66
uint32 droppedEventsCount() const
uint32 size() const
Definition: EventMessage.h:76
bool empty() const
Definition: EventMsg.cc:72
unsigned long totalDataSize() const
Definition: EventMsg.cc:60
void setDroppedEventsCount(unsigned int count)
Definition: EventMsg.cc:47