CMS 3D CMS Logo

Public Member Functions | Private Attributes

RBCProcessTestSignal Class Reference

#include <RBCProcessTestSignal.h>

Inheritance diagram for RBCProcessTestSignal:
ProcessInputSignal

List of all members.

Public Member Functions

int next ()
 RBCProcessTestSignal ()
 Standard constructor.
 RBCProcessTestSignal (const char *)
RPCInputSignalretrievedata ()
void rewind ()
void showfirst ()
virtual ~RBCProcessTestSignal ()
 Destructor.

Private Attributes

std::ifstream * m_in
RBCInputm_input
RPCInputSignalm_lbin

Detailed Description

Author:
Andres Osorio

email: aosorio@uniandes.edu.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.

{}; 
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().

{
  
  m_in = new std::ifstream();
  m_in->open(f_name);
  
  if(!m_in->is_open()) {
    std::cout << "RBCProcessTestSignal> cannot open file" << std::endl;
  } else { 
    std::cout << "RBCProcessTestSignal> file is now open" << std::endl;
  }
  
  m_input = new RBCInput();
  m_lbin  = dynamic_cast<RPCInputSignal*>( new RBCLinkBoardSignal( m_input ) );
  
  showfirst();

}
RBCProcessTestSignal::~RBCProcessTestSignal ( ) [virtual]

Destructor.

Definition at line 38 of file RBCProcessTestSignal.cc.

References m_in, m_input, and m_lbin.

{
  m_in->close();
  delete m_in;

  if ( m_lbin  ) delete m_lbin;
  
  if ( m_input ) delete m_input;
  
} 

Member Function Documentation

int RBCProcessTestSignal::next ( void  ) [virtual]

Implements ProcessInputSignal.

Definition at line 51 of file RBCProcessTestSignal.cc.

References m_in.

{
  
  if ( m_in->fail()) return 0;
  (*m_in) >> (*m_input);
  if ( m_in->eof() ) return 0;
  return 1;
  
}
RPCInputSignal* RBCProcessTestSignal::retrievedata ( ) [inline, virtual]

Implements ProcessInputSignal.

Definition at line 41 of file RBCProcessTestSignal.h.

References m_lbin.

                                  { 
    return  m_lbin; 
  };
void RBCProcessTestSignal::rewind ( )

Definition at line 70 of file RBCProcessTestSignal.cc.

References m_in.

Referenced by showfirst().

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

Definition at line 61 of file RBCProcessTestSignal.cc.

References gather_cfg::cout, and rewind().

Referenced by RBCProcessTestSignal().

{
  rewind();
  (*m_in) >> (*m_input);
  std::cout << (*m_input);
  rewind();
  
}

Member Data Documentation

std::ifstream* RBCProcessTestSignal::m_in [private]

Definition at line 43 of file RBCProcessTestSignal.h.

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

Definition at line 51 of file RBCProcessTestSignal.h.

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