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 25 of file RBCProcessTestSignal.h.

Constructor & Destructor Documentation

◆ RBCProcessTestSignal()

RBCProcessTestSignal::RBCProcessTestSignal ( const char *  f_name)
explicit

Definition at line 15 of file RBCProcessTestSignal.cc.

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

◆ ~RBCProcessTestSignal()

RBCProcessTestSignal::~RBCProcessTestSignal ( )
override

Destructor.

Definition at line 30 of file RBCProcessTestSignal.cc.

30 { m_in.close(); }

References m_in.

Member Function Documentation

◆ next()

int RBCProcessTestSignal::next ( void  )
overridevirtual

Implements ProcessInputSignal.

Definition at line 34 of file RBCProcessTestSignal.cc.

34  {
35  if (m_in.fail())
36  return 0;
37  m_in >> m_input;
38  if (m_in.eof())
39  return 0;
40  return 1;
41 }

References m_in, and m_input.

◆ retrievedata()

RPCInputSignal* RBCProcessTestSignal::retrievedata ( )
inlineoverridevirtual

Implements ProcessInputSignal.

Definition at line 37 of file RBCProcessTestSignal.h.

37 { return m_lbin.get(); };

References m_lbin.

◆ rewind()

void RBCProcessTestSignal::rewind ( )

Definition at line 50 of file RBCProcessTestSignal.cc.

50  {
51  m_in.clear();
52  m_in.seekg(0, std::ios::beg);
53 }

References m_in.

Referenced by showfirst().

◆ showfirst()

void RBCProcessTestSignal::showfirst ( )

Definition at line 43 of file RBCProcessTestSignal.cc.

43  {
44  rewind();
45  m_in >> m_input;
46  std::cout << m_input;
47  rewind();
48 }

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

Member Data Documentation

◆ m_in

std::ifstream RBCProcessTestSignal::m_in
private

Definition at line 37 of file RBCProcessTestSignal.h.

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

◆ m_input

RBCInput RBCProcessTestSignal::m_input
private

Definition at line 43 of file RBCProcessTestSignal.h.

Referenced by next(), and showfirst().

◆ m_lbin

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

Definition at line 45 of file RBCProcessTestSignal.h.

Referenced by retrievedata().

gather_cfg.cout
cout
Definition: gather_cfg.py:144
RBCProcessTestSignal::m_in
std::ifstream m_in
Definition: RBCProcessTestSignal.h:37
RBCProcessTestSignal::m_lbin
std::unique_ptr< RPCInputSignal > m_lbin
Definition: RBCProcessTestSignal.h:45
RBCProcessTestSignal::showfirst
void showfirst()
Definition: RBCProcessTestSignal.cc:43
RBCProcessTestSignal::rewind
void rewind()
Definition: RBCProcessTestSignal.cc:50
RBCProcessTestSignal::m_input
RBCInput m_input
Definition: RBCProcessTestSignal.h:43