allow constructing WellTestConfig from variables

also add accessor and equality operator
This commit is contained in:
Arne Morten Kvarving
2019-12-09 11:18:55 +01:00
parent f0786fb88a
commit a91ce46ca3
2 changed files with 24 additions and 0 deletions

View File

@@ -57,6 +57,8 @@ public:
};
WellTestConfig();
WellTestConfig(const std::vector<WTESTWell>& well);
void add_well(const std::string& well, Reason reason, double test_interval, int num_test, double startup_time, int current_step);
void add_well(const std::string& well, const std::string& reasons, double test_interval,
int num_test, double startup_time, int current_step);
@@ -66,8 +68,12 @@ public:
const WTESTWell& get(const std::string& well, Reason reason) const;
size_t size() const;
const std::vector<WTESTWell>& getWells() const;
static std::string reasonToString(const Reason reason);
bool operator==(const WellTestConfig& data) const;
private:
std::vector<WTESTWell> wells;

View File

@@ -28,6 +28,12 @@ WellTestConfig::WellTestConfig() {
}
WellTestConfig::WellTestConfig(const std::vector<WTESTWell>& well)
: wells(well)
{
}
void WellTestConfig::add_well(const std::string& well, Reason shut_reason, double test_interval,
int num_retries, double startup_time, const int current_step) {
@@ -144,6 +150,18 @@ size_t WellTestConfig::size() const {
return wells.size();
}
const std::vector<WellTestConfig::WTESTWell>& WellTestConfig::getWells() const {
return wells;
}
bool WellTestConfig::operator==(const WellTestConfig& data) const {
return this->getWells() == data.getWells();
}
}