CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RBCProcessTestSignal Class Reference

#include <RBCProcessTestSignal.h>

Inheritance diagram for RBCProcessTestSignal:
ProcessInputSignal

Public Member Functions

int next () override
 
 RBCProcessTestSignal (const char *)
 
RPCInputSignalretrievedata () override
 
void rewind ()
 
void showfirst ()
 
 ~RBCProcessTestSignal () override
 Destructor. More...
 
- Public Member Functions inherited from ProcessInputSignal
virtual ~ProcessInputSignal ()
 

Private Attributes

std::ifstream m_in
 
RBCInput m_input
 
std::unique_ptr< RPCInputSignalm_lbin
 

Detailed Description

Author
Andres Osorio

email: aosor.nosp@m.io@u.nosp@m.niand.nosp@m.es.e.nosp@m.du.co

Date
2008-10-10

Definition at line 26 of file RBCProcessTestSignal.h.

Constructor & Destructor Documentation

RBCProcessTestSignal::RBCProcessTestSignal ( const char *  f_name)
explicit

Definition at line 16 of file RBCProcessTestSignal.cc.

References gather_cfg::cout, m_in, m_input, m_lbin, and showfirst().

16  :
17  m_in{},
18  m_input{},
19  m_lbin{std::make_unique<RBCLinkBoardSignal>( &m_input ) }
20 {
21  m_in.open(f_name);
22 
23  if(!m_in.is_open()) {
24  std::cout << "RBCProcessTestSignal> cannot open file" << std::endl;
25  } else {
26  std::cout << "RBCProcessTestSignal> file is now open" << std::endl;
27  }
28 
29  showfirst();
30 
31 }
std::unique_ptr< RPCInputSignal > m_lbin
RBCProcessTestSignal::~RBCProcessTestSignal ( )
override

Destructor.

Definition at line 35 of file RBCProcessTestSignal.cc.

References m_in.

36 {
37  m_in.close();
38 }

Member Function Documentation

int RBCProcessTestSignal::next ( void  )
overridevirtual

Implements ProcessInputSignal.

Definition at line 42 of file RBCProcessTestSignal.cc.

References m_in, and m_input.

43 {
44 
45  if ( m_in.fail()) return 0;
46  m_in >> m_input;
47  if ( m_in.eof() ) return 0;
48  return 1;
49 
50 }
RPCInputSignal* RBCProcessTestSignal::retrievedata ( )
inlineoverridevirtual

Implements ProcessInputSignal.

Definition at line 38 of file RBCProcessTestSignal.h.

References m_lbin.

38  {
39  return m_lbin.get();
40  };
std::unique_ptr< RPCInputSignal > m_lbin
void RBCProcessTestSignal::rewind ( )

Definition at line 61 of file RBCProcessTestSignal.cc.

References m_in.

Referenced by showfirst().

62 {
63  m_in.clear();
64  m_in.seekg(0,std::ios::beg);
65 }
void RBCProcessTestSignal::showfirst ( )

Definition at line 52 of file RBCProcessTestSignal.cc.

References gather_cfg::cout, m_in, m_input, and rewind().

Referenced by RBCProcessTestSignal().

53 {
54  rewind();
55  m_in >> m_input;
56  std::cout << m_input;
57  rewind();
58 
59 }

Member Data Documentation

std::ifstream RBCProcessTestSignal::m_in
private
RBCInput RBCProcessTestSignal::m_input
private

Definition at line 48 of file RBCProcessTestSignal.h.

Referenced by next(), RBCProcessTestSignal(), and showfirst().

std::unique_ptr<RPCInputSignal> RBCProcessTestSignal::m_lbin
private

Definition at line 50 of file RBCProcessTestSignal.h.

Referenced by RBCProcessTestSignal(), and retrievedata().