CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/EventFilter/SMProxyServer/src/EventMsg.cc

Go to the documentation of this file.
00001 // $Id: EventMsg.cc,v 1.1.4.2 2011/03/07 12:01:12 mommsen Exp $
00003 
00004 #include "EventFilter/SMProxyServer/interface/EventMsg.h"
00005 
00006 
00007 namespace smproxy
00008 {
00009 
00010   EventMsg::EventMsg() :
00011   faulty_(true)
00012   {}
00013   
00014   
00015   EventMsg::EventMsg(const EventMsgView& eventMsgView) :
00016   faulty_(false)
00017   {
00018     buf_.reset( new EventMsgBuffer(eventMsgView.size()) );
00019     std::copy(
00020       eventMsgView.startAddress(),
00021       eventMsgView.startAddress()+eventMsgView.size(),
00022       &(*buf_)[0]
00023     );
00024   }
00025   
00026   
00027   void EventMsg::tagForEventConsumers(const stor::QueueIDs& queueIDs)
00028   {
00029     queueIDs_ = queueIDs;
00030   }
00031   
00032   
00033   const stor::QueueIDs& EventMsg::getEventConsumerTags() const
00034   {
00035     return queueIDs_;
00036   }
00037   
00038   
00039   size_t EventMsg::memoryUsed() const
00040   {
00041     return sizeof(buf_);
00042   }
00043   
00044   
00045   unsigned long EventMsg::totalDataSize() const
00046   {
00047     return buf_->size();
00048   }
00049   
00050   
00051   unsigned char* EventMsg::dataLocation() const
00052   {
00053     return &(*buf_)[0];
00054   }
00055   
00056   
00057   bool EventMsg::empty() const
00058   {
00059     return (buf_.get() == 0);
00060   }
00061 
00062 
00063   bool EventMsg::faulty() const
00064   {
00065     return faulty_;
00066   }
00067 
00068 } // namespace smproxy
00069