Browse Source

Changed filename parameter for DeterministicSparseTransitionParser to a

const reference to an std::string, instead of char pointer
tempestpy_adaptions
Lanchid 12 years ago
parent
commit
3c741fae4a
  1. 2
      src/mrmc.cpp
  2. 4
      src/parser/DeterministicSparseTransitionParser.cpp
  3. 2
      src/parser/DeterministicSparseTransitionParser.h
  4. 2
      src/utility/IoUtility.cpp
  5. 2
      src/utility/IoUtility.h

2
src/mrmc.cpp

@ -101,7 +101,7 @@ int main(const int argc, const char* argv[]) {
LOG4CPLUS_INFO(logger, "Enable verbose mode, log output gets printed to console.");
}
mrmc::parser::DeterministicSparseTransitionParser traparser(s->getString("trafile").c_str());
mrmc::parser::DeterministicSparseTransitionParser traparser(s->getString("trafile"));
mrmc::parser::LabParser labparser(traparser.getMatrix()->getRowCount(), s->getString("labfile").c_str());
mrmc::models::Dtmc<double> dtmc(traparser.getMatrix(), labparser.getLabeling());

4
src/parser/DeterministicSparseTransitionParser.cpp

@ -106,7 +106,7 @@ uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, uint_fas
* @return a pointer to the created sparse matrix.
*/
DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(const char * filename)
DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(std::string const &filename)
: matrix(nullptr)
{
/*
@ -117,7 +117,7 @@ DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(const c
/*
* open file
*/
MappedFile file(filename);
MappedFile file(filename.c_str());
char* buf = file.data;
/*

2
src/parser/DeterministicSparseTransitionParser.h

@ -20,7 +20,7 @@ namespace parser {
*/
class DeterministicSparseTransitionParser : Parser {
public:
DeterministicSparseTransitionParser(const char* filename);
DeterministicSparseTransitionParser(std::string const &filename);
std::shared_ptr<mrmc::storage::SquareSparseMatrix<double>> getMatrix() {
return this->matrix;

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(const char* tra_file, const char* lab_file) {
mrmc::models::Dtmc<double>* parseDTMC(std::string const &tra_file, const char* 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(const char* tra_file, const char* lab_file);
mrmc::models::Dtmc<double>* parseDTMC(std::string const &tra_file, const char* lab_file);
} //namespace utility

Loading…
Cancel
Save