Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

src/FileReader.cpp File Reference

#include <vector>
#include <string>
#include <queue>
#include <sstream>
#include <fstream>
#include <iostream>
#include "FileReader.h"
#include "MessageController.h"
#include "lex.yy.c"

Include dependency graph for FileReader.cpp:

Go to the source code of this file.

Functions

void Tokenize (const string &str, shared_ptr< vector< shared_ptr< string > > > tokens, const string &delimiters=" ")
bool send (char *line)
void * flexRead (void *ptr)
void * readFile (void *ptr)

Variables

FileReadermyr


Function Documentation

void* flexRead void *  ptr  ) 
 

Thread to read the input file generated by Traplas containing a simulation. This thread uses flex to process the input file. Entire messages are matched, then these messages are sent to the MessageController. When a line in the inputfile is not recognised, a message is send to cout containing the linenumber and the unrecognised message itself.

Definition at line 89 of file FileReader.cpp.

References FileReader::filename.

void* readFile void *  ptr  ) 
 

Thread to read the input file generated by Traplas containing a simulation. This thread uses a simple way the read a file, it offers no checks whatsoever on what it reads. It just reads lines using a getline(), then it makes token using a space(" ") as delimiter. Then it sends the messages to the MessageController.

Definition at line 100 of file FileReader.cpp.

References FileReader::filename, FileReader::filereadthread_run, FileReader::msgcontroller, MessageController::processMessageFromComm(), and Tokenize().

Here is the call graph for this function:

bool send char *  line  ) 
 

Helper function for yylex() to send messages to the MessageController. It sends the message to the MessageController.

Definition at line 73 of file FileReader.cpp.

References FileReader::msgcontroller, MessageController::processMessageFromComm(), and Tokenize().

Here is the call graph for this function:

void Tokenize const string &  str,
shared_ptr< vector< shared_ptr< string > > >  tokens,
const string &  delimiters = " "
 

Definition at line 49 of file FileReader.cpp.

Referenced by readFile(), and send().


Variable Documentation

FileReader* myr
 

Definition at line 71 of file FileReader.cpp.


Generated on Mon Jun 19 10:22:09 2006 for TraplasVisualisation by  doxygen 1.4.4