Files
Jungfraujoch/broker/gen/model/Plots.cpp
2024-11-22 21:25:20 +01:00

141 lines
3.1 KiB
C++

/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.25
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Plots.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Plots::Plots()
{
m_Title = "";
m_TitleIsSet = false;
}
void Plots::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Plots::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Plots::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Plots" : pathPrefix;
/* Plot */ {
const std::vector<org::openapitools::server::model::Plot>& value = m_Plot;
const std::string currentValuePath = _pathPrefix + ".plot";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const org::openapitools::server::model::Plot& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".plot") && success;
i++;
}
}
}
return success;
}
bool Plots::operator==(const Plots& rhs) const
{
return
((!titleIsSet() && !rhs.titleIsSet()) || (titleIsSet() && rhs.titleIsSet() && getTitle() == rhs.getTitle())) &&
(getPlot() == rhs.getPlot())
;
}
bool Plots::operator!=(const Plots& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Plots& o)
{
j = nlohmann::json::object();
if(o.titleIsSet())
j["title"] = o.m_Title;
j["plot"] = o.m_Plot;
}
void from_json(const nlohmann::json& j, Plots& o)
{
if(j.find("title") != j.end())
{
j.at("title").get_to(o.m_Title);
o.m_TitleIsSet = true;
}
j.at("plot").get_to(o.m_Plot);
}
std::string Plots::getTitle() const
{
return m_Title;
}
void Plots::setTitle(std::string const& value)
{
m_Title = value;
m_TitleIsSet = true;
}
bool Plots::titleIsSet() const
{
return m_TitleIsSet;
}
void Plots::unsetTitle()
{
m_TitleIsSet = false;
}
std::vector<org::openapitools::server::model::Plot> Plots::getPlot() const
{
return m_Plot;
}
void Plots::setPlot(std::vector<org::openapitools::server::model::Plot> const& value)
{
m_Plot = value;
}
} // namespace org::openapitools::server::model