Browse Source

Initialize layoutInfo with default values to fix warning

tempestpy_adaptions
Matthias Volk 8 years ago
parent
commit
cc4d2f27d4
  1. 4
      src/storm-dft/storage/dft/DFT.h
  2. 3
      src/storm-dft/storage/dft/DFTBuilder.cpp
  3. 7
      src/storm-dft/storage/dft/DFTLayoutInfo.h

4
src/storm-dft/storage/dft/DFT.h

@ -270,10 +270,6 @@ namespace storm {
}
DFTLayoutInfo const& getElementLayoutInfo(size_t id) const {
if(mLayoutInfo.count(id) == 0) {
STORM_LOG_WARN("Layout info for element with id " << id << " not found");
return DFTLayoutInfo();
}
return mLayoutInfo.at(id);
}

3
src/storm-dft/storage/dft/DFTBuilder.cpp

@ -97,6 +97,9 @@ namespace storm {
for (auto& elem : mElements) {
if(mLayoutInfo.count(elem.first) > 0) {
dft.setElementLayoutInfo(elem.second->id(), mLayoutInfo.at(elem.first));
} else {
// Set default layout
dft.setElementLayoutInfo(elem.second->id(), storm::storage::DFTLayoutInfo());
}
}

7
src/storm-dft/storage/dft/DFTLayoutInfo.h

@ -3,13 +3,14 @@
namespace storm {
namespace storage {
struct DFTLayoutInfo {
DFTLayoutInfo() {};
DFTLayoutInfo() : x(20.0), y(20.0) {
};
DFTLayoutInfo(double x, double y) : x(x), y(y) {};
// x location
double x = 0.0;
double x;
// y location
double y = 0.0;
double y;
};
}
}
Loading…
Cancel
Save