CMS 3D CMS Logo

Public Member Functions | Private Attributes

edmtest::TestConsumer Class Reference

#include <TestConsumer.h>

List of all members.

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.

                                                 :
    worker_(new Worker(ps.getParameter<std::string>("fileName"),
                       ps.getUntrackedParameter<int>("numPerFile",1<<31))),
    bufs_(buf)
  {
    // first write out all the product registry data into the front
    // of the output file (in text format)
  }
edmtest::TestConsumer::~TestConsumer ( )

Definition at line 105 of file TestConsumer.cc.

  {
  }

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_.

  {
    worker_->checkCount();

    EventBuffer::ConsumerBuffer cb(*bufs_);

    int sz = cb.size();
    worker_->ost_->write((const char*)(&sz),sizeof(int));
    worker_->ost_->write((const char*)cb.buffer(),sz);

  }
void edmtest::TestConsumer::sendRegistry ( void *  buf,
int  len 
)

Definition at line 127 of file TestConsumer.cc.

References worker_.

  {
    worker_->saveReg(buf,len);
    worker_->writeReg();
  }
void edmtest::TestConsumer::stop ( )

Definition at line 121 of file TestConsumer.cc.

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

  {
    EventBuffer::ProducerBuffer pb(*bufs_);
    pb.commit();
  }

Member Data Documentation

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