OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
FilenameObserver.cpp
1#include "FilenameObserver.hpp"
2#include "MDLexer.hpp"
3#include "MDParser.hpp"
4
5FilenameObserver::FilenameObserver() : parser_(NULL), lexer_(NULL) {}
6void FilenameObserver::setParser(MDParser* parser) {parser_ = parser;}
7void FilenameObserver::setLexer(MDLexer* lexer) {lexer_ = lexer;}
8void FilenameObserver::notify(const std::string& filename) {
9 if (lexer_)
10 lexer_->setFilename(filename);
11 if (parser_)
12 parser_->setFilename(filename);
13}