src/airflow/contam/PrjReader.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #ifndef AIRFLOW_CONTAM_PRJREADER_HPP | ||
| 7 | #define AIRFLOW_CONTAM_PRJREADER_HPP | ||
| 8 | |||
| 9 | #include <sstream> | ||
| 10 | #include "../../utilities/core/Logger.hpp" | ||
| 11 | #include "../../utilities/core/Filesystem.hpp" | ||
| 12 | |||
| 13 | #include "PrjDefines.hpp" | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | namespace contam { | ||
| 17 | |||
| 18 | class Reader | ||
| 19 | { | ||
| 20 | public: | ||
| 21 | explicit Reader(openstudio::filesystem::ifstream& file); | ||
| 22 | explicit Reader(const std::string& string, int starting = 0); | ||
| 23 | 6 | ~Reader() = default; | |
| 24 | |||
| 25 | double readDouble(); | ||
| 26 | std::string readString(); | ||
| 27 | int readInt(); | ||
| 28 | unsigned readUInt(); | ||
| 29 | |||
| 30 | std::string readLine(); | ||
| 31 | void read999(); | ||
| 32 | void read999(std::string mesg); | ||
| 33 | void readEnd(); | ||
| 34 | |||
| 35 | void skipSection(); | ||
| 36 | std::string readSection(); | ||
| 37 | ✗ | int lineNumber() const { | |
| 38 | ✗ | return m_lineNumber; | |
| 39 | } | ||
| 40 | |||
| 41 | template <class T> | ||
| 42 | std::vector<T> readSectionVector(const std::string& name = std::string()); | ||
| 43 | |||
| 44 | std::vector<int> readIntVector(bool terminated = false); | ||
| 45 | // std::vector<int> readIntStdVector(bool terminated=false); | ||
| 46 | // template <class T> QList<T*> readSectionPointers(std::string name=STRING_INIT); | ||
| 47 | // template <class T> QList<T> readSectionList(STRING name=STRING_INIT); | ||
| 48 | // template <class T, template <class T> class V> V<T> readSectionVector(STRING name); | ||
| 49 | // template <class T> QVector<T> readSectionQVector(STRING name=STRING_INIT); | ||
| 50 | // template <class T> std::vector<T> readSectionStdVector(STRING name=STRING_INIT); | ||
| 51 | template <class T> | ||
| 52 | std::vector<std::shared_ptr<T>> readElementVector(const std::string& name = std::string()); | ||
| 53 | template <class T> | ||
| 54 | T read(); | ||
| 55 | template <class T> | ||
| 56 | T readNumber(); | ||
| 57 | |||
| 58 | private: | ||
| 59 | std::string readStdString(); | ||
| 60 | std::string readLineString(); | ||
| 61 | |||
| 62 | std::stringstream m_stream; | ||
| 63 | int m_lineNumber; | ||
| 64 | std::list<std::string> m_entries; | ||
| 65 | |||
| 66 | − | REGISTER_LOGGER("openstudio.contam.Reader"); | |
| 67 | }; | ||
| 68 | |||
| 69 | template <class T> | ||
| 70 | 48 | std::vector<T> Reader::readSectionVector(const std::string& name) { | |
| 71 | 48 | int n = readInt(); | |
| 72 | 48 | std::vector<T> vector; | |
| 73 |
13/16std::vector<openstudio::contam::Ahs, std::allocator<openstudio::contam::Ahs> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Ahs>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::AirflowPath, std::allocator<openstudio::contam::AirflowPath> > openstudio::contam::Reader::readSectionVector<openstudio::contam::AirflowPath>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::DaySchedule, std::allocator<openstudio::contam::DaySchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::DaySchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::Level, std::allocator<openstudio::contam::Level> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Level>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::Species, std::allocator<openstudio::contam::Species> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Species>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 12 times.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::WeekSchedule, std::allocator<openstudio::contam::WeekSchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WeekSchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::WindPressureProfile, std::allocator<openstudio::contam::WindPressureProfile> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WindPressureProfile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 30 times.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::Zone, std::allocator<openstudio::contam::Zone> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Zone>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
348 | for (int i = 0; i < n; i++) { |
| 74 |
5/8std::vector<openstudio::contam::Ahs, std::allocator<openstudio::contam::Ahs> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Ahs>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
std::vector<openstudio::contam::AirflowPath, std::allocator<openstudio::contam::AirflowPath> > openstudio::contam::Reader::readSectionVector<openstudio::contam::AirflowPath>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
std::vector<openstudio::contam::DaySchedule, std::allocator<openstudio::contam::DaySchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::DaySchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
std::vector<openstudio::contam::Level, std::allocator<openstudio::contam::Level> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Level>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
std::vector<openstudio::contam::Species, std::allocator<openstudio::contam::Species> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Species>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 12 times.
std::vector<openstudio::contam::WeekSchedule, std::allocator<openstudio::contam::WeekSchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WeekSchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
std::vector<openstudio::contam::WindPressureProfile, std::allocator<openstudio::contam::WindPressureProfile> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WindPressureProfile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 30 times.
std::vector<openstudio::contam::Zone, std::allocator<openstudio::contam::Zone> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Zone>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
|
300 | T value; |
| 75 |
5/8std::vector<openstudio::contam::Ahs, std::allocator<openstudio::contam::Ahs> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Ahs>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
std::vector<openstudio::contam::AirflowPath, std::allocator<openstudio::contam::AirflowPath> > openstudio::contam::Reader::readSectionVector<openstudio::contam::AirflowPath>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
std::vector<openstudio::contam::DaySchedule, std::allocator<openstudio::contam::DaySchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::DaySchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
std::vector<openstudio::contam::Level, std::allocator<openstudio::contam::Level> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Level>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
std::vector<openstudio::contam::Species, std::allocator<openstudio::contam::Species> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Species>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 12 times.
std::vector<openstudio::contam::WeekSchedule, std::allocator<openstudio::contam::WeekSchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WeekSchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
std::vector<openstudio::contam::WindPressureProfile, std::allocator<openstudio::contam::WindPressureProfile> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WindPressureProfile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 30 times.
std::vector<openstudio::contam::Zone, std::allocator<openstudio::contam::Zone> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Zone>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
|
300 | value.read(*this); |
| 76 |
5/8std::vector<openstudio::contam::Ahs, std::allocator<openstudio::contam::Ahs> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Ahs>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
std::vector<openstudio::contam::AirflowPath, std::allocator<openstudio::contam::AirflowPath> > openstudio::contam::Reader::readSectionVector<openstudio::contam::AirflowPath>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
std::vector<openstudio::contam::DaySchedule, std::allocator<openstudio::contam::DaySchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::DaySchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
std::vector<openstudio::contam::Level, std::allocator<openstudio::contam::Level> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Level>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
std::vector<openstudio::contam::Species, std::allocator<openstudio::contam::Species> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Species>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 12 times.
std::vector<openstudio::contam::WeekSchedule, std::allocator<openstudio::contam::WeekSchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WeekSchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
std::vector<openstudio::contam::WindPressureProfile, std::allocator<openstudio::contam::WindPressureProfile> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WindPressureProfile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 30 times.
std::vector<openstudio::contam::Zone, std::allocator<openstudio::contam::Zone> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Zone>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
|
300 | vector.push_back(value); |
| 77 | } | ||
| 78 |
8/16std::vector<openstudio::contam::Ahs, std::allocator<openstudio::contam::Ahs> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Ahs>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::AirflowPath, std::allocator<openstudio::contam::AirflowPath> > openstudio::contam::Reader::readSectionVector<openstudio::contam::AirflowPath>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::DaySchedule, std::allocator<openstudio::contam::DaySchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::DaySchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::Level, std::allocator<openstudio::contam::Level> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Level>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::Species, std::allocator<openstudio::contam::Species> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Species>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::WeekSchedule, std::allocator<openstudio::contam::WeekSchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WeekSchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::WindPressureProfile, std::allocator<openstudio::contam::WindPressureProfile> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WindPressureProfile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<openstudio::contam::Zone, std::allocator<openstudio::contam::Zone> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Zone>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
48 | if (name.empty()) { |
| 79 | ✗ | read999("Failed to find section termination"); | |
| 80 | } else { | ||
| 81 |
24/24std::vector<openstudio::contam::Ahs, std::allocator<openstudio::contam::Ahs> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Ahs>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<openstudio::contam::AirflowPath, std::allocator<openstudio::contam::AirflowPath> > openstudio::contam::Reader::readSectionVector<openstudio::contam::AirflowPath>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<openstudio::contam::DaySchedule, std::allocator<openstudio::contam::DaySchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::DaySchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<openstudio::contam::Level, std::allocator<openstudio::contam::Level> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Level>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<openstudio::contam::Species, std::allocator<openstudio::contam::Species> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Species>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<openstudio::contam::WeekSchedule, std::allocator<openstudio::contam::WeekSchedule> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WeekSchedule>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<openstudio::contam::WindPressureProfile, std::allocator<openstudio::contam::WindPressureProfile> > openstudio::contam::Reader::readSectionVector<openstudio::contam::WindPressureProfile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<openstudio::contam::Zone, std::allocator<openstudio::contam::Zone> > openstudio::contam::Reader::readSectionVector<openstudio::contam::Zone>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
|
48 | read999("Failed to find " + name + " section termination"); |
| 82 | } | ||
| 83 | 48 | return vector; | |
| 84 | ✗ | } | |
| 85 | |||
| 86 | //template <class T> QList<T*> Reader::readSectionPointers(std::string name) | ||
| 87 | //{ | ||
| 88 | // QList<T*> list; | ||
| 89 | // T *object; | ||
| 90 | // int n = readInt(); | ||
| 91 | // for(int i=0;i<n;i++) | ||
| 92 | // { | ||
| 93 | // object = new T(); | ||
| 94 | // list << object; | ||
| 95 | // object->read(this); | ||
| 96 | // } | ||
| 97 | // if(IS_NULL(name)) | ||
| 98 | // read999("Failed to find section termination"); | ||
| 99 | // else | ||
| 100 | // read999("Failed to find "+name+" section termination"); | ||
| 101 | // return list; | ||
| 102 | //} | ||
| 103 | |||
| 104 | //template <class T> QList<T> Reader::readSectionList(std::string name) | ||
| 105 | //{ | ||
| 106 | // QList<T> list; | ||
| 107 | // int n = readInt(); | ||
| 108 | // for(int i=0;i<n;i++) | ||
| 109 | // { | ||
| 110 | // T object; | ||
| 111 | // object.read(this); | ||
| 112 | // list << object; | ||
| 113 | // } | ||
| 114 | // if(IS_NULL(name)) | ||
| 115 | // read999("Failed to find section termination"); | ||
| 116 | // else | ||
| 117 | // read999("Failed to find "+name+" section termination"); | ||
| 118 | // return list; | ||
| 119 | //} | ||
| 120 | |||
| 121 | //template <class T, template <class T> class V> V<T> Reader::readSectionVector(std::string name) | ||
| 122 | //{ | ||
| 123 | // int n = readInt(); | ||
| 124 | // V<T> vector(n); | ||
| 125 | // for(int i=0;i<n;i++) | ||
| 126 | // vector[i].read(*this); | ||
| 127 | // if(IS_NULL(name)) | ||
| 128 | // read999("Failed to find section termination"); | ||
| 129 | // else | ||
| 130 | // read999("Failed to find "+name+" section termination"); | ||
| 131 | // return vector; | ||
| 132 | //} | ||
| 133 | |||
| 134 | //template <class T> QVector<T> Reader::readSectionQVector(std::string name) | ||
| 135 | //{ | ||
| 136 | // int n = readInt(); | ||
| 137 | // QVector<T> vector(n); | ||
| 138 | // for(int i=0;i<n;i++) | ||
| 139 | // vector[i].read(*this); | ||
| 140 | // if(IS_NULL(name)) | ||
| 141 | // read999("Failed to find section termination"); | ||
| 142 | // else | ||
| 143 | // read999("Failed to find "+name+" section termination"); | ||
| 144 | // return vector; | ||
| 145 | //} | ||
| 146 | |||
| 147 | //template <class T> std::vector<T> Reader::readSectionStdVector(std::string name) | ||
| 148 | //{ | ||
| 149 | // int n = readInt(); | ||
| 150 | // std::vector<T> vector; | ||
| 151 | // for(int i=0;i<n;i++) | ||
| 152 | // { | ||
| 153 | // T v; | ||
| 154 | // v.read(*this); | ||
| 155 | // vector.push_back(v); | ||
| 156 | // } | ||
| 157 | // if(IS_NULL(name)) | ||
| 158 | // read999("Failed to find section termination"); | ||
| 159 | // else | ||
| 160 | // read999("Failed to find "+name+" section termination"); | ||
| 161 | // return vector; | ||
| 162 | //} | ||
| 163 | |||
| 164 | template <class T> | ||
| 165 | 12 | std::vector<std::shared_ptr<T>> Reader::readElementVector(const std::string& name) { | |
| 166 | 12 | int n = readInt(); | |
| 167 | 12 | std::vector<std::shared_ptr<T>> vector; | |
| 168 |
3/4std::vector<std::shared_ptr<openstudio::contam::AirflowElement>, std::allocator<std::shared_ptr<openstudio::contam::AirflowElement> > > openstudio::contam::Reader::readElementVector<openstudio::contam::AirflowElement>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 0 taken 126 times.
✓ Branch 1 taken 6 times.
std::vector<std::shared_ptr<openstudio::contam::ControlNode>, std::allocator<std::shared_ptr<openstudio::contam::ControlNode> > > openstudio::contam::Reader::readElementVector<openstudio::contam::ControlNode>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
|
138 | for (int i = 0; i < n; i++) { |
| 169 |
3/6std::vector<std::shared_ptr<openstudio::contam::AirflowElement>, std::allocator<std::shared_ptr<openstudio::contam::AirflowElement> > > openstudio::contam::Reader::readElementVector<openstudio::contam::AirflowElement>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 126 times.
✓ Branch 4 taken 126 times.
✓ Branch 7 taken 126 times.
std::vector<std::shared_ptr<openstudio::contam::ControlNode>, std::allocator<std::shared_ptr<openstudio::contam::ControlNode> > > openstudio::contam::Reader::readElementVector<openstudio::contam::ControlNode>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
✗ Branch 7 not taken.
|
126 | vector.push_back(std::shared_ptr<T>(T::readElement(*this))); |
| 170 | } | ||
| 171 |
2/4std::vector<std::shared_ptr<openstudio::contam::AirflowElement>, std::allocator<std::shared_ptr<openstudio::contam::AirflowElement> > > openstudio::contam::Reader::readElementVector<openstudio::contam::AirflowElement>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
std::vector<std::shared_ptr<openstudio::contam::ControlNode>, std::allocator<std::shared_ptr<openstudio::contam::ControlNode> > > openstudio::contam::Reader::readElementVector<openstudio::contam::ControlNode>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | if (name.empty()) { |
| 172 | ✗ | read999("Failed to find section termination"); | |
| 173 | } else { | ||
| 174 |
6/6std::vector<std::shared_ptr<openstudio::contam::AirflowElement>, std::allocator<std::shared_ptr<openstudio::contam::AirflowElement> > > openstudio::contam::Reader::readElementVector<openstudio::contam::AirflowElement>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
std::vector<std::shared_ptr<openstudio::contam::ControlNode>, std::allocator<std::shared_ptr<openstudio::contam::ControlNode> > > openstudio::contam::Reader::readElementVector<openstudio::contam::ControlNode>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
|
12 | read999("Failed to find " + name + " section termination"); |
| 175 | } | ||
| 176 | 12 | return vector; | |
| 177 | ✗ | } | |
| 178 | |||
| 179 | /* | ||
| 180 | template <class T> QVector<QSharedPointer<T> > Reader::readElementQVector(std::string name) | ||
| 181 | { | ||
| 182 | int n = readInt(); | ||
| 183 | QVector<QSharedPointer<T> > vector(n); | ||
| 184 | for(int i = 0; i<n; i++) | ||
| 185 | { | ||
| 186 | // No reset in 4.8 | ||
| 187 | QSharedPointer<T> element(T::readElement(*this)); | ||
| 188 | vector[i].swap(element); | ||
| 189 | //vector[i].reset(T::readElement(this)); | ||
| 190 | } | ||
| 191 | if(name.empty()) | ||
| 192 | read999("Failed to find section termination"); | ||
| 193 | else | ||
| 194 | read999("Failed to find " + name + " section termination"); | ||
| 195 | return vector; | ||
| 196 | } | ||
| 197 | */ | ||
| 198 | |||
| 199 | } // namespace contam | ||
| 200 | } // namespace openstudio | ||
| 201 | |||
| 202 | #endif // AIRFLOW_CONTAM_PRJREADER_HPP | ||
| 203 |