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
RBCProcessTestSignal Class Reference

#include <RBCProcessTestSignal.h>

Inheritance diagram for RBCProcessTestSignal:
ProcessInputSignal

Public Member Functions

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

Private Attributes

std::ifstream * m_in
 
RBCInputm_input
 
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 ( )
inline

Standard constructor.

Definition at line 29 of file RBCProcessTestSignal.h.

29 {};
RBCProcessTestSignal::RBCProcessTestSignal ( const char *  f_name)

Definition at line 17 of file RBCProcessTestSignal.cc.

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

18 {
19 
20  m_in = new std::ifstream();
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  m_input = new RBCInput();
30  m_lbin = dynamic_cast<RPCInputSignal*>( new RBCLinkBoardSignal( m_input ) );
31 
32  showfirst();
33 
34 }
tuple cout
Definition: gather_cfg.py:121
RBCProcessTestSignal::~RBCProcessTestSignal ( )
virtual

Destructor.

Definition at line 38 of file RBCProcessTestSignal.cc.

References m_in, m_input, and m_lbin.

39 {
40  m_in->close();
41  delete m_in;
42 
43  if ( m_lbin ) delete m_lbin;
44 
45  if ( m_input ) delete m_input;
46 
47 }

Member Function Documentation

int RBCProcessTestSignal::next ( void  )
virtual

Implements ProcessInputSignal.

Definition at line 51 of file RBCProcessTestSignal.cc.

References m_in.

52 {
53 
54  if ( m_in->fail()) return 0;
55  (*m_in) >> (*m_input);
56  if ( m_in->eof() ) return 0;
57  return 1;
58 
59 }
RPCInputSignal* RBCProcessTestSignal::retrievedata ( )
inlinevirtual

Implements ProcessInputSignal.

Definition at line 41 of file RBCProcessTestSignal.h.

References m_lbin.

41  {
42  return m_lbin;
43  };
void RBCProcessTestSignal::rewind ( )

Definition at line 70 of file RBCProcessTestSignal.cc.

References m_in.

Referenced by showfirst().

71 {
72  m_in->clear();
73  m_in->seekg(0,std::ios::beg);
74 }
void RBCProcessTestSignal::showfirst ( )

Definition at line 61 of file RBCProcessTestSignal.cc.

References gather_cfg::cout, and rewind().

Referenced by RBCProcessTestSignal().

62 {
63  rewind();
64  (*m_in) >> (*m_input);
65  std::cout << (*m_input);
66  rewind();
67 
68 }
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::ifstream* RBCProcessTestSignal::m_in
private

Definition at line 43 of file RBCProcessTestSignal.h.

Referenced by next(), RBCProcessTestSignal(), rewind(), and ~RBCProcessTestSignal().

RBCInput* RBCProcessTestSignal::m_input
private

Definition at line 51 of file RBCProcessTestSignal.h.

Referenced by RBCProcessTestSignal(), and ~RBCProcessTestSignal().

RPCInputSignal* RBCProcessTestSignal::m_lbin
private