Browse Source

Changed type of parameter filename to std::string const & (was const

char*)
tempestpy_adaptions
Lanchid 12 years ago
parent
commit
daa5cf297a
  1. 2
      src/mrmc.cpp
  2. 5
      src/parser/AtomicPropositionLabelingParser.cpp
  3. 2
      src/parser/AtomicPropositionLabelingParser.h
  4. 2
      src/utility/IoUtility.cpp
  5. 2
      src/utility/IoUtility.h

2
src/mrmc.cpp

@ -102,7 +102,7 @@ int main(const int argc, const char* argv[]) {
}
mrmc::parser::DeterministicSparseTransitionParser traparser(s->getString("trafile"));
mrmc::parser::AtomicPropositionLabelingParser labparser(traparser.getMatrix()->getRowCount(), s->getString("labfile").c_str());
mrmc::parser::AtomicPropositionLabelingParser labparser(traparser.getMatrix()->getRowCount(), s->getString("labfile"));
mrmc::models::Dtmc<double> dtmc(traparser.getMatrix(), labparser.getLabeling());
dtmc.printModelInformationToStream(std::cout);

5
src/parser/AtomicPropositionLabelingParser.cpp

@ -38,13 +38,14 @@ namespace parser {
* @param filename input .lab file's name.
* @return The pointer to the created labeling object.
*/
AtomicPropositionLabelingParser::AtomicPropositionLabelingParser(uint_fast64_t node_count, const char * filename)
AtomicPropositionLabelingParser::AtomicPropositionLabelingParser(uint_fast64_t node_count,
std::string const & filename)
: labeling(nullptr)
{
/*
* open file
*/
MappedFile file(filename);
MappedFile file(filename.c_str());
char* buf = file.data;
/*

2
src/parser/AtomicPropositionLabelingParser.h

@ -19,7 +19,7 @@ namespace parser {
*/
class AtomicPropositionLabelingParser : Parser {
public:
AtomicPropositionLabelingParser(uint_fast64_t node_count, const char* filename);
AtomicPropositionLabelingParser(uint_fast64_t node_count, std::string const &filename);
std::shared_ptr<mrmc::models::AtomicPropositionsLabeling> getLabeling() {
return this->labeling;

2
src/utility/IoUtility.cpp

@ -60,7 +60,7 @@ void dtmcToDot(mrmc::models::Dtmc<double>* dtmc, std::string filename) {
}
//TODO: Should this stay here or be integrated in the new parser structure?
mrmc::models::Dtmc<double>* parseDTMC(std::string const &tra_file, const char* lab_file) {
mrmc::models::Dtmc<double>* parseDTMC(std::string const &tra_file, std::string const &lab_file) {
mrmc::parser::DeterministicSparseTransitionParser tp(tra_file);
uint_fast64_t node_count = tp.getMatrix()->getRowCount();

2
src/utility/IoUtility.h

@ -36,7 +36,7 @@ void dtmcToDot(mrmc::models::Dtmc<double>* dtmc, std::string filename);
@returns The DTMC described by the two files.
*/
mrmc::models::Dtmc<double>* parseDTMC(std::string const &tra_file, const char* lab_file);
mrmc::models::Dtmc<double>* parseDTMC(std::string const &tra_file, std::string const &lab_file);
} //namespace utility

Loading…
Cancel
Save