CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
edmtest::Worker Struct Reference

Public Member Functions

void checkCount ()
 
void saveReg (void *buf, int len)
 
 Worker (const std::string &s, int m)
 
void writeReg ()
 

Public Attributes

int cnt_
 
int file_num_
 
std::string filename_
 
int max_
 
OutPtr ost_
 
SaveArea reg_
 

Detailed Description

Definition at line 39 of file TestConsumer.cc.

Constructor & Destructor Documentation

edmtest::Worker::Worker ( const std::string &  s,
int  m 
)

Definition at line 55 of file TestConsumer.cc.

55  :
56  filename_(s),
57  file_num_(),
58  cnt_(0),
59  max_(m),
61  {
62  }
OutPtr makeFile(const std::string name, int num)
Definition: TestConsumer.cc:25
std::string filename_
Definition: TestConsumer.cc:43

Member Function Documentation

void edmtest::Worker::checkCount ( )

Definition at line 64 of file TestConsumer.cc.

References cnt_, file_num_, filename_, edmtest::makeFile(), max_, ost_, and writeReg().

65  {
66  if(cnt_!=0 && (cnt_%max_) == 0)
67  {
68  ++file_num_;
70  writeReg();
71  }
72  ++cnt_;
73 
74  }
OutPtr makeFile(const std::string name, int num)
Definition: TestConsumer.cc:25
std::string filename_
Definition: TestConsumer.cc:43
void edmtest::Worker::saveReg ( void *  buf,
int  len 
)

Definition at line 86 of file TestConsumer.cc.

References reg_.

87  {
88  reg_.resize(len);
89  memcpy(&reg_[0],buf,len);
90  }
void edmtest::Worker::writeReg ( )

Definition at line 76 of file TestConsumer.cc.

References ost_, and reg_.

Referenced by checkCount().

77  {
78  if(!reg_.empty())
79  {
80  int len = reg_.size();
81  ost_->write((const char*)(&len),sizeof(int));
82  ost_->write((const char*)&reg_[0],len);
83  }
84  }

Member Data Documentation

int edmtest::Worker::cnt_

Definition at line 45 of file TestConsumer.cc.

Referenced by checkCount().

int edmtest::Worker::file_num_

Definition at line 44 of file TestConsumer.cc.

Referenced by checkCount().

std::string edmtest::Worker::filename_

Definition at line 43 of file TestConsumer.cc.

Referenced by checkCount().

int edmtest::Worker::max_

Definition at line 46 of file TestConsumer.cc.

Referenced by checkCount().

OutPtr edmtest::Worker::ost_

Definition at line 47 of file TestConsumer.cc.

Referenced by checkCount(), and writeReg().

SaveArea edmtest::Worker::reg_

Definition at line 48 of file TestConsumer.cc.

Referenced by saveReg(), and writeReg().