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 Attributes
edmtest::TestConsumer Class Reference

#include <TestConsumer.h>

Public Member Functions

void bufferReady ()
 
void sendRegistry (void *buf, int len)
 
void stop ()
 
 TestConsumer (edm::ParameterSet const &ps, edm::EventBuffer *buf)
 
 ~TestConsumer ()
 

Private Attributes

edm::EventBufferbufs_
 
boost::shared_ptr< Workerworker_
 

Detailed Description

Definition at line 13 of file TestConsumer.h.

Constructor & Destructor Documentation

edmtest::TestConsumer::TestConsumer ( edm::ParameterSet const &  ps,
edm::EventBuffer buf 
)

Definition at line 95 of file TestConsumer.cc.

96  :
97  worker_(new Worker(ps.getParameter<std::string>("fileName"),
98  ps.getUntrackedParameter<int>("numPerFile",1<<31))),
99  bufs_(buf)
100  {
101  // first write out all the product registry data into the front
102  // of the output file (in text format)
103  }
edm::EventBuffer * bufs_
Definition: TestConsumer.h:27
boost::shared_ptr< Worker > worker_
Definition: TestConsumer.h:26
edmtest::TestConsumer::~TestConsumer ( )

Definition at line 105 of file TestConsumer.cc.

106  {
107  }

Member Function Documentation

void edmtest::TestConsumer::bufferReady ( )

Definition at line 109 of file TestConsumer.cc.

References edm::EventBuffer::OperateBuffer< T >::buffer(), bufs_, edm::EventBuffer::OperateBuffer< T >::size(), and worker_.

110  {
111  worker_->checkCount();
112 
114 
115  int sz = cb.size();
116  worker_->ost_->write((const char*)(&sz),sizeof(int));
117  worker_->ost_->write((const char*)cb.buffer(),sz);
118 
119  }
edm::EventBuffer * bufs_
Definition: TestConsumer.h:27
boost::shared_ptr< Worker > worker_
Definition: TestConsumer.h:26
void edmtest::TestConsumer::sendRegistry ( void *  buf,
int  len 
)

Definition at line 127 of file TestConsumer.cc.

References worker_.

128  {
129  worker_->saveReg(buf,len);
130  worker_->writeReg();
131  }
boost::shared_ptr< Worker > worker_
Definition: TestConsumer.h:26
void edmtest::TestConsumer::stop ( )

Definition at line 121 of file TestConsumer.cc.

References bufs_, and edm::EventBuffer::OperateBuffer< T >::commit().

122  {
124  pb.commit();
125  }
edm::EventBuffer * bufs_
Definition: TestConsumer.h:27

Member Data Documentation

edm::EventBuffer* edmtest::TestConsumer::bufs_
private

Definition at line 27 of file TestConsumer.h.

Referenced by bufferReady(), and stop().

boost::shared_ptr<Worker> edmtest::TestConsumer::worker_
private

Definition at line 26 of file TestConsumer.h.

Referenced by bufferReady(), and sendRegistry().