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.1.2.4 2011/02/28 18:22:34 mommsen Exp $
3 
5 
6 
7 namespace smproxy
8 {
9 
11  faulty_(true)
12  {}
13 
14 
15  EventMsg::EventMsg(const EventMsgView& eventMsgView) :
16  faulty_(false)
17  {
18  buf_.reset( new EventMsgBuffer(eventMsgView.size()) );
19  std::copy(
20  eventMsgView.startAddress(),
21  eventMsgView.startAddress()+eventMsgView.size(),
22  &(*buf_)[0]
23  );
24  }
25 
26 
28  {
29  queueIDs_ = queueIDs;
30  }
31 
32 
34  {
35  return queueIDs_;
36  }
37 
38 
39  size_t EventMsg::memoryUsed() const
40  {
41  return sizeof(buf_);
42  }
43 
44 
45  unsigned long EventMsg::totalDataSize() const
46  {
47  return buf_->size();
48  }
49 
50 
51  unsigned char* EventMsg::dataLocation() const
52  {
53  return &(*buf_)[0];
54  }
55 
56 
57  bool EventMsg::empty() const
58  {
59  return (buf_.get() == 0);
60  }
61 
62 
63  bool EventMsg::faulty() const
64  {
65  return faulty_;
66  }
67 
68 } // namespace smproxy
69 
uint8 * startAddress() const
Definition: EventMessage.h:69
std::vector< QueueID > QueueIDs
Definition: QueueID.h:80
std::vector< unsigned char > EventMsgBuffer
Definition: EventMsg.h:68
size_t memoryUsed() const
Definition: EventMsg.cc:39
const stor::QueueIDs & getEventConsumerTags() const
Definition: EventMsg.cc:33
bool faulty() const
Definition: EventMsg.cc:63
boost::shared_ptr< EventMsgBuffer > buf_
Definition: EventMsg.h:69
stor::QueueIDs queueIDs_
Definition: EventMsg.h:72
void tagForEventConsumers(const stor::QueueIDs &)
Definition: EventMsg.cc:27
unsigned char * dataLocation() const
Definition: EventMsg.cc:51
uint32 size() const
Definition: EventMessage.h:66
bool empty() const
Definition: EventMsg.cc:57
unsigned long totalDataSize() const
Definition: EventMsg.cc:45