CFEL - ASG Software Suite  2.5.0
CASS
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cass::FileReader Class Referenceabstract

base class for all file readers More...

#include <file_reader.h>

+ Inheritance diagram for cass::FileReader:
+ Collaboration diagram for cass::FileReader:

Public Types

typedef std::tr1::shared_ptr< FileReadershared_pointer
 typedef the shared pointer of this More...
 

Public Member Functions

virtual ~FileReader ()
 virtual destructor More...
 
virtual bool operator() (std::ifstream &file, CASSEvent &event)=0
 read the file contents More...
 
virtual void loadSettings ()=0
 load the settings of the reader More...
 
virtual void readHeaderInfo (std::ifstream &)
 read the file header More...
 
void filename (const std::string &filename)
 set the filename of the instance More...
 
const std::string & filename () const
 retrieve the filename that this instance is working on More...
 
std::string type () const
 return the type of file that this is for More...
 

Static Public Member Functions

static shared_pointer instance (const std::string &filename)
 create an instance of the requested type More...
 

Protected Member Functions

 FileReader ()
 only inheritants can create this More...
 
 FileReader (const std::string &type)
 set the readers type More...
 

Protected Attributes

std::string _filename
 the name of the file that we read the values from More...
 
std::string _type
 the reader type as string More...
 

Detailed Description

base class for all file readers

Author
Lutz Foucar

Definition at line 24 of file file_reader.h.

Member Typedef Documentation

typedef std::tr1::shared_ptr<FileReader> cass::FileReader::shared_pointer

typedef the shared pointer of this

Definition at line 28 of file file_reader.h.

Constructor & Destructor Documentation

virtual cass::FileReader::~FileReader ( )
inlinevirtual

virtual destructor

Definition at line 31 of file file_reader.h.

cass::FileReader::FileReader ( )
inlineprotected

only inheritants can create this

Definition at line 83 of file file_reader.h.

cass::FileReader::FileReader ( const std::string &  type)
inlineprotected

set the readers type

Parameters
typeThe type of the reader

Definition at line 89 of file file_reader.h.

Member Function Documentation

void cass::FileReader::filename ( const std::string &  filename)
inline

set the filename of the instance

Parameters
filenamethe filename of the file that this reader is working on

Definition at line 67 of file file_reader.h.

References _filename, and filename().

Referenced by filename().

const std::string& cass::FileReader::filename ( ) const
inline

retrieve the filename that this instance is working on

Returns
filename the filename of the file that this reader is working on

Definition at line 73 of file file_reader.h.

References _filename.

FileReader::shared_pointer FileReader::instance ( const std::string &  filename)
static

create an instance of the requested type

The type is determined from the filename

Returns
a shared pointer to the requested type
Parameters
filenamethe filename of the file that this reader is working on

set the filename

Definition at line 29 of file file_reader.cpp.

References QString::fromStdString(), info, and QFileInfo::suffix().

Referenced by cass::MultiFileInput::runthis().

virtual void cass::FileReader::loadSettings ( )
pure virtual
virtual bool cass::FileReader::operator() ( std::ifstream &  file,
CASSEvent event 
)
pure virtual

read the file contents

should read the file contents and convert them so that they can be put into the cassevent

Returns
true when the workers should work on the filled cassevent, false if not.
Parameters
filethe file that contains the data to be put into the cassevent
eventthe CASSEvent where the data will be put into

Implemented in cass::TxtReader, cass::pixeldetector::Frms6Reader, cass::ACQIRIS::LmaReader, cass::XtcReader, and cass::pixeldetector::RAWSSSReader.

virtual void cass::FileReader::readHeaderInfo ( std::ifstream &  )
inlinevirtual

read the file header

Parameters
filethe filestream to the header information of the file

Reimplemented in cass::TxtReader, cass::XtcReader, cass::pixeldetector::Frms6Reader, cass::ACQIRIS::LmaReader, and cass::pixeldetector::RAWSSSReader.

Definition at line 61 of file file_reader.h.

Referenced by cass::TxtParser::runthis().

std::string cass::FileReader::type ( ) const
inline

return the type of file that this is for

Returns
the type of reader

Definition at line 79 of file file_reader.h.

References _type.

Member Data Documentation

std::string cass::FileReader::_filename
protected
std::string cass::FileReader::_type
protected

the reader type as string

Definition at line 95 of file file_reader.h.

Referenced by type().


The documentation for this class was generated from the following files: