MURE
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Types | Private Attributes | List of all members
Serpent::OutputReader Class Referenceabstract

#include <SerpentOutputReader.hxx>

Inheritance diagram for Serpent::OutputReader:
Serpent::DetectorOutputReader Serpent::ResultOutputReader Serpent::VolumeCalcOutputReader

Public Member Functions

 OutputReader ()
 constructor
 
virtual ~OutputReader ()
 destructor
 
virtual void Read (const string &fileName)
 
bool isFileRead () const
 returns if file was read
 
virtual void Clear ()=0
 
virtual string Print ()=0
 
virtual void Write (const string &fileName)
 writes data using Print method into new result file (for multi-run)
 
virtual OutputReaderGetNewInstance ()=0
 

Protected Member Functions

bool IsWhite (const string &line) const
 resturns true if line conststs of only white spaces
 
char GetSeparator () const
 resturns sepeparator (white space or semiclon)
 
bool HasPermision (const string &rowName) const
 returns true if row name(heading) is added to allowe rows
 
void AddAllowedRow (const string &rowName)
 adds row head to rows which are allowed to be read
 
void AddForbiddenRow (const string &rowName)
 adds row head to rows which are NOT allowed to be read
 
void AllowRowsByDefault ()
 sets default perrmision to read rows to true
 
void ForbiddRowsByDefault ()
 sets default perrmision to read rows to false
 
void SetSeparator (char separator)
 sets separator
 
virtual void ParseBlock (const string &block)=0
 
vector< string > GetPermittedRowNames () const
 gets all rows which can be read
 

Static Protected Attributes

static const char COMMENT_CHAR = '%'
 

Private Types

typedef map< string, bool > Permitions
 

Private Attributes

char fSeparator
 
Permitions fPermissions
 
bool fDefaultPermission
 
bool fFileReadSuccessfully
 

Detailed Description

Defines an abstract reader class.

Serpent result and detector files are formated with matlab synthax. For example: name1 = [1, 2, 3 ...]; name2 = [1, 2, 3 ...]; ...

Volume stimation files are formated with serpent synthax. For example: testmat1 0 9.99353E+05 % (0.001)

In this class some common rules of dealing with this files are defined.

Allways data is segregated into rows. Allways each row starts with its name. (which can mean different things, however it is allways unique indexing variable)

This class is trying to take adventage of this similarities.

Author
J.Hajnrych
PTO
Version
1.0

Member Typedef Documentation

◆ Permitions

typedef map< string, bool > Serpent::OutputReader::Permitions
private

Constructor & Destructor Documentation

◆ OutputReader()

Serpent::OutputReader::OutputReader ( )

constructor

◆ ~OutputReader()

Serpent::OutputReader::~OutputReader ( )
virtual

destructor

Member Function Documentation

◆ AddAllowedRow()

void Serpent::OutputReader::AddAllowedRow ( const string &  rowName)
protected

adds row head to rows which are allowed to be read

◆ AddForbiddenRow()

void Serpent::OutputReader::AddForbiddenRow ( const string &  rowName)
protected

adds row head to rows which are NOT allowed to be read

◆ AllowRowsByDefault()

void Serpent::OutputReader::AllowRowsByDefault ( )
protected

sets default perrmision to read rows to true

◆ Clear()

virtual void Serpent::OutputReader::Clear ( )
pure virtual

◆ ForbiddRowsByDefault()

void Serpent::OutputReader::ForbiddRowsByDefault ( )
protected

sets default perrmision to read rows to false

◆ GetNewInstance()

virtual OutputReader * Serpent::OutputReader::GetNewInstance ( )
pure virtual

◆ GetPermittedRowNames()

vector< string > Serpent::OutputReader::GetPermittedRowNames ( ) const
protected

gets all rows which can be read

◆ GetSeparator()

char Serpent::OutputReader::GetSeparator ( ) const
protected

resturns sepeparator (white space or semiclon)

◆ HasPermision()

bool Serpent::OutputReader::HasPermision ( const string &  rowName) const
protected

returns true if row name(heading) is added to allowe rows

◆ isFileRead()

bool Serpent::OutputReader::isFileRead ( ) const

returns if file was read

◆ IsWhite()

bool Serpent::OutputReader::IsWhite ( const string &  line) const
protected

resturns true if line conststs of only white spaces

◆ ParseBlock()

virtual void Serpent::OutputReader::ParseBlock ( const string &  block)
protectedpure virtual

◆ Print()

virtual string Serpent::OutputReader::Print ( )
pure virtual

◆ Read()

void Serpent::OutputReader::Read ( const string &  fileName)
virtual

◆ SetSeparator()

void Serpent::OutputReader::SetSeparator ( char  separator)
protected

sets separator

◆ Write()

void Serpent::OutputReader::Write ( const string &  fileName)
virtual

writes data using Print method into new result file (for multi-run)

Member Data Documentation

◆ COMMENT_CHAR

const char Serpent::OutputReader::COMMENT_CHAR = '%'
staticprotected

◆ fDefaultPermission

bool Serpent::OutputReader::fDefaultPermission
private

◆ fFileReadSuccessfully

bool Serpent::OutputReader::fFileReadSuccessfully
private

◆ fPermissions

Permitions Serpent::OutputReader::fPermissions
private

◆ fSeparator

char Serpent::OutputReader::fSeparator
private

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

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024