OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
FileStream Class Reference

A stream of input tokens. More...

#include <FileStream.h>

Inheritance diagram for FileStream:
Collaboration diagram for FileStream:

Public Member Functions

 FileStream (const std::string &name)
 Constructor.
virtual ~FileStream ()
 Destructor.
virtual bool fillLine ()
 Read next input line.
virtual Token readToken ()
 Read single token from file.
void putBack (const Token &token)
 Put token back to stream.
const std::string & getName () const
 Return stream name.
int getLine () const
 Return line number.
int addReference () const
 Increment reference count.
int removeReference () const
 Decrement the reference count.
bool isShared () const
 Test for sharing.

Static Public Member Functions

static void setEcho (bool flag)
 Set echo flag.
static bool getEcho ()
 Return echo flag.

Protected Member Functions

Token readNumber ()
Token readString ()
Token readWord ()
bool skipComments ()

Protected Attributes

std::string line
int curr_char
std::string stream_name
int curr_line
bool put_back_flag
Token put_back

Private Member Functions

 FileStream ()
 FileStream (const FileStream &)
void operator= (const FileStream &)

Private Attributes

std::ifstream is
int refCount

Static Private Attributes

static bool echoFlag = false

Detailed Description

A stream of input tokens.

Definition at line 32 of file FileStream.h.

Constructor & Destructor Documentation

◆ FileStream() [1/3]

FileStream::FileStream ( const std::string & name)
explicit

Constructor.

Definition at line 33 of file FileStream.cpp.

References AbsFileStream::AbsFileStream(), and is.

Referenced by FileStream(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~FileStream()

FileStream::~FileStream ( )
virtual

Destructor.

Definition at line 39 of file FileStream.cpp.

◆ FileStream() [2/3]

FileStream::FileStream ( )
private

◆ FileStream() [3/3]

FileStream::FileStream ( const FileStream & )
private

References FileStream().

Here is the call graph for this function:

Member Function Documentation

◆ addReference()

int RCObject::addReference ( ) const
inlineinherited

Increment reference count.

Definition at line 83 of file RCObject.h.

References refCount.

Referenced by Pointer< Object >::operator=(), Pointer< Object >::operator=(), and Pointer< Object >::unique().

Here is the caller graph for this function:

◆ fillLine()

bool FileStream::fillLine ( )
virtual

Read next input line.

Implements AbsFileStream.

Definition at line 50 of file FileStream.cpp.

References AbsFileStream::curr_char, TokenStream::curr_line, echoFlag, is, AbsFileStream::line, and TokenStream::stream_name.

◆ getEcho()

bool FileStream::getEcho ( )
static

Return echo flag.

Definition at line 46 of file FileStream.cpp.

References echoFlag.

◆ getLine()

int TokenStream::getLine ( ) const
inherited

Return line number.

Definition at line 49 of file TokenStream.cpp.

References curr_line.

◆ getName()

const std::string & TokenStream::getName ( ) const
inherited

Return stream name.

Definition at line 54 of file TokenStream.cpp.

References stream_name.

◆ isShared()

bool RCObject::isShared ( ) const
inlineinherited

Test for sharing.

Definition at line 93 of file RCObject.h.

References refCount.

◆ operator=()

void FileStream::operator= ( const FileStream & )
private

References FileStream().

Here is the call graph for this function:

◆ putBack()

void TokenStream::putBack ( const Token & token)
inherited

Put token back to stream.

Definition at line 38 of file TokenStream.cpp.

References put_back, and put_back_flag.

◆ readNumber()

Token AbsFileStream::readNumber ( )
protectedinherited

Definition at line 144 of file AbsFileStream.cpp.

References curr_char, TokenStream::curr_line, Token::IS_ERROR, line, and TokenStream::stream_name.

Referenced by readToken().

Here is the caller graph for this function:

◆ readString()

Token AbsFileStream::readString ( )
protectedinherited

Definition at line 232 of file AbsFileStream.cpp.

References curr_char, TokenStream::curr_line, Token::IS_ERROR, Token::IS_STRING, line, and TokenStream::stream_name.

Referenced by readToken().

Here is the caller graph for this function:

◆ readToken()

Token AbsFileStream::readToken ( )
virtualinherited

Read single token from file.

Implements TokenStream.

Definition at line 42 of file AbsFileStream.cpp.

References curr_char, TokenStream::curr_line, fillLine(), Token::IS_DELIMITER, Token::IS_EOF, Token::IS_ERROR, line, TokenStream::put_back, TokenStream::put_back_flag, readNumber(), readString(), readToken(), readWord(), skipComments(), and TokenStream::stream_name.

Referenced by readToken().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readWord()

Token AbsFileStream::readWord ( )
protectedinherited

Definition at line 260 of file AbsFileStream.cpp.

References curr_char, TokenStream::curr_line, Token::IS_WORD, line, and TokenStream::stream_name.

Referenced by readToken().

Here is the caller graph for this function:

◆ removeReference()

int RCObject::removeReference ( ) const
inlineinherited

Decrement the reference count.

Definition at line 88 of file RCObject.h.

References refCount.

◆ setEcho()

void FileStream::setEcho ( bool flag)
static

Set echo flag.

Definition at line 42 of file FileStream.cpp.

References echoFlag.

Referenced by Option::execute(), main(), and Option::Option().

Here is the caller graph for this function:

◆ skipComments()

bool AbsFileStream::skipComments ( )
protectedinherited

Definition at line 278 of file AbsFileStream.cpp.

References curr_char, fillLine(), line, and skipComments().

Referenced by readToken(), and skipComments().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ curr_char

int AbsFileStream::curr_char
protectedinherited

◆ curr_line

◆ echoFlag

bool FileStream::echoFlag = false
staticprivate

Definition at line 66 of file FileStream.h.

Referenced by fillLine(), getEcho(), and setEcho().

◆ is

std::ifstream FileStream::is
private

Definition at line 63 of file FileStream.h.

Referenced by FileStream(), and fillLine().

◆ line

std::string AbsFileStream::line
protectedinherited

◆ put_back

Token TokenStream::put_back
protectedinherited

◆ put_back_flag

bool TokenStream::put_back_flag
protectedinherited

◆ refCount

int RCObject::refCount
mutableprivateinherited

Definition at line 76 of file RCObject.h.

Referenced by addReference(), isShared(), RCObject(), RCObject(), and removeReference().

◆ stream_name


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