310 lines
7.5 KiB
C++
310 lines
7.5 KiB
C++
/**
|
|
* Jungfraujoch writer
|
|
* Jungfraujoch Writer Web API
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0.rc_11
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
#include "Writer_statistics.h"
|
|
#include "Helpers.h"
|
|
|
|
#include <sstream>
|
|
|
|
namespace org::openapitools::server::model
|
|
{
|
|
|
|
Writer_statistics::Writer_statistics()
|
|
{
|
|
m_Nimages = 0L;
|
|
m_NimagesIsSet = false;
|
|
m_Performance_MBs = 0.0f;
|
|
m_Performance_MBsIsSet = false;
|
|
m_Performance_Hz = 0.0f;
|
|
m_Performance_HzIsSet = false;
|
|
m_Run_number = 0L;
|
|
m_Run_numberIsSet = false;
|
|
m_Run_name = "";
|
|
m_Run_nameIsSet = false;
|
|
m_File_prefix = "";
|
|
m_File_prefixIsSet = false;
|
|
m_Socket_number = 0L;
|
|
m_Socket_numberIsSet = false;
|
|
m_State = "";
|
|
m_StateIsSet = false;
|
|
|
|
}
|
|
|
|
void Writer_statistics::validate() const
|
|
{
|
|
std::stringstream msg;
|
|
if (!validate(msg))
|
|
{
|
|
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
|
}
|
|
}
|
|
|
|
bool Writer_statistics::validate(std::stringstream& msg) const
|
|
{
|
|
return validate(msg, "");
|
|
}
|
|
|
|
bool Writer_statistics::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
|
{
|
|
bool success = true;
|
|
const std::string _pathPrefix = pathPrefix.empty() ? "Writer_statistics" : pathPrefix;
|
|
|
|
|
|
return success;
|
|
}
|
|
|
|
bool Writer_statistics::operator==(const Writer_statistics& rhs) const
|
|
{
|
|
return
|
|
|
|
|
|
|
|
((!nimagesIsSet() && !rhs.nimagesIsSet()) || (nimagesIsSet() && rhs.nimagesIsSet() && getNimages() == rhs.getNimages())) &&
|
|
|
|
|
|
((!performanceMBsIsSet() && !rhs.performanceMBsIsSet()) || (performanceMBsIsSet() && rhs.performanceMBsIsSet() && getPerformanceMBs() == rhs.getPerformanceMBs())) &&
|
|
|
|
|
|
((!performanceHzIsSet() && !rhs.performanceHzIsSet()) || (performanceHzIsSet() && rhs.performanceHzIsSet() && getPerformanceHz() == rhs.getPerformanceHz())) &&
|
|
|
|
|
|
((!runNumberIsSet() && !rhs.runNumberIsSet()) || (runNumberIsSet() && rhs.runNumberIsSet() && getRunNumber() == rhs.getRunNumber())) &&
|
|
|
|
|
|
((!runNameIsSet() && !rhs.runNameIsSet()) || (runNameIsSet() && rhs.runNameIsSet() && getRunName() == rhs.getRunName())) &&
|
|
|
|
|
|
((!filePrefixIsSet() && !rhs.filePrefixIsSet()) || (filePrefixIsSet() && rhs.filePrefixIsSet() && getFilePrefix() == rhs.getFilePrefix())) &&
|
|
|
|
|
|
((!socketNumberIsSet() && !rhs.socketNumberIsSet()) || (socketNumberIsSet() && rhs.socketNumberIsSet() && getSocketNumber() == rhs.getSocketNumber())) &&
|
|
|
|
|
|
((!stateIsSet() && !rhs.stateIsSet()) || (stateIsSet() && rhs.stateIsSet() && getState() == rhs.getState()))
|
|
|
|
;
|
|
}
|
|
|
|
bool Writer_statistics::operator!=(const Writer_statistics& rhs) const
|
|
{
|
|
return !(*this == rhs);
|
|
}
|
|
|
|
void to_json(nlohmann::json& j, const Writer_statistics& o)
|
|
{
|
|
j = nlohmann::json();
|
|
if(o.nimagesIsSet())
|
|
j["nimages"] = o.m_Nimages;
|
|
if(o.performanceMBsIsSet())
|
|
j["performance_MBs"] = o.m_Performance_MBs;
|
|
if(o.performanceHzIsSet())
|
|
j["performance_Hz"] = o.m_Performance_Hz;
|
|
if(o.runNumberIsSet())
|
|
j["run_number"] = o.m_Run_number;
|
|
if(o.runNameIsSet())
|
|
j["run_name"] = o.m_Run_name;
|
|
if(o.filePrefixIsSet())
|
|
j["file_prefix"] = o.m_File_prefix;
|
|
if(o.socketNumberIsSet())
|
|
j["socket_number"] = o.m_Socket_number;
|
|
if(o.stateIsSet())
|
|
j["state"] = o.m_State;
|
|
|
|
}
|
|
|
|
void from_json(const nlohmann::json& j, Writer_statistics& o)
|
|
{
|
|
if(j.find("nimages") != j.end())
|
|
{
|
|
j.at("nimages").get_to(o.m_Nimages);
|
|
o.m_NimagesIsSet = true;
|
|
}
|
|
if(j.find("performance_MBs") != j.end())
|
|
{
|
|
j.at("performance_MBs").get_to(o.m_Performance_MBs);
|
|
o.m_Performance_MBsIsSet = true;
|
|
}
|
|
if(j.find("performance_Hz") != j.end())
|
|
{
|
|
j.at("performance_Hz").get_to(o.m_Performance_Hz);
|
|
o.m_Performance_HzIsSet = true;
|
|
}
|
|
if(j.find("run_number") != j.end())
|
|
{
|
|
j.at("run_number").get_to(o.m_Run_number);
|
|
o.m_Run_numberIsSet = true;
|
|
}
|
|
if(j.find("run_name") != j.end())
|
|
{
|
|
j.at("run_name").get_to(o.m_Run_name);
|
|
o.m_Run_nameIsSet = true;
|
|
}
|
|
if(j.find("file_prefix") != j.end())
|
|
{
|
|
j.at("file_prefix").get_to(o.m_File_prefix);
|
|
o.m_File_prefixIsSet = true;
|
|
}
|
|
if(j.find("socket_number") != j.end())
|
|
{
|
|
j.at("socket_number").get_to(o.m_Socket_number);
|
|
o.m_Socket_numberIsSet = true;
|
|
}
|
|
if(j.find("state") != j.end())
|
|
{
|
|
j.at("state").get_to(o.m_State);
|
|
o.m_StateIsSet = true;
|
|
}
|
|
|
|
}
|
|
|
|
int64_t Writer_statistics::getNimages() const
|
|
{
|
|
return m_Nimages;
|
|
}
|
|
void Writer_statistics::setNimages(int64_t const value)
|
|
{
|
|
m_Nimages = value;
|
|
m_NimagesIsSet = true;
|
|
}
|
|
bool Writer_statistics::nimagesIsSet() const
|
|
{
|
|
return m_NimagesIsSet;
|
|
}
|
|
void Writer_statistics::unsetNimages()
|
|
{
|
|
m_NimagesIsSet = false;
|
|
}
|
|
float Writer_statistics::getPerformanceMBs() const
|
|
{
|
|
return m_Performance_MBs;
|
|
}
|
|
void Writer_statistics::setPerformanceMBs(float const value)
|
|
{
|
|
m_Performance_MBs = value;
|
|
m_Performance_MBsIsSet = true;
|
|
}
|
|
bool Writer_statistics::performanceMBsIsSet() const
|
|
{
|
|
return m_Performance_MBsIsSet;
|
|
}
|
|
void Writer_statistics::unsetPerformance_MBs()
|
|
{
|
|
m_Performance_MBsIsSet = false;
|
|
}
|
|
float Writer_statistics::getPerformanceHz() const
|
|
{
|
|
return m_Performance_Hz;
|
|
}
|
|
void Writer_statistics::setPerformanceHz(float const value)
|
|
{
|
|
m_Performance_Hz = value;
|
|
m_Performance_HzIsSet = true;
|
|
}
|
|
bool Writer_statistics::performanceHzIsSet() const
|
|
{
|
|
return m_Performance_HzIsSet;
|
|
}
|
|
void Writer_statistics::unsetPerformance_Hz()
|
|
{
|
|
m_Performance_HzIsSet = false;
|
|
}
|
|
int64_t Writer_statistics::getRunNumber() const
|
|
{
|
|
return m_Run_number;
|
|
}
|
|
void Writer_statistics::setRunNumber(int64_t const value)
|
|
{
|
|
m_Run_number = value;
|
|
m_Run_numberIsSet = true;
|
|
}
|
|
bool Writer_statistics::runNumberIsSet() const
|
|
{
|
|
return m_Run_numberIsSet;
|
|
}
|
|
void Writer_statistics::unsetRun_number()
|
|
{
|
|
m_Run_numberIsSet = false;
|
|
}
|
|
std::string Writer_statistics::getRunName() const
|
|
{
|
|
return m_Run_name;
|
|
}
|
|
void Writer_statistics::setRunName(std::string const& value)
|
|
{
|
|
m_Run_name = value;
|
|
m_Run_nameIsSet = true;
|
|
}
|
|
bool Writer_statistics::runNameIsSet() const
|
|
{
|
|
return m_Run_nameIsSet;
|
|
}
|
|
void Writer_statistics::unsetRun_name()
|
|
{
|
|
m_Run_nameIsSet = false;
|
|
}
|
|
std::string Writer_statistics::getFilePrefix() const
|
|
{
|
|
return m_File_prefix;
|
|
}
|
|
void Writer_statistics::setFilePrefix(std::string const& value)
|
|
{
|
|
m_File_prefix = value;
|
|
m_File_prefixIsSet = true;
|
|
}
|
|
bool Writer_statistics::filePrefixIsSet() const
|
|
{
|
|
return m_File_prefixIsSet;
|
|
}
|
|
void Writer_statistics::unsetFile_prefix()
|
|
{
|
|
m_File_prefixIsSet = false;
|
|
}
|
|
int64_t Writer_statistics::getSocketNumber() const
|
|
{
|
|
return m_Socket_number;
|
|
}
|
|
void Writer_statistics::setSocketNumber(int64_t const value)
|
|
{
|
|
m_Socket_number = value;
|
|
m_Socket_numberIsSet = true;
|
|
}
|
|
bool Writer_statistics::socketNumberIsSet() const
|
|
{
|
|
return m_Socket_numberIsSet;
|
|
}
|
|
void Writer_statistics::unsetSocket_number()
|
|
{
|
|
m_Socket_numberIsSet = false;
|
|
}
|
|
std::string Writer_statistics::getState() const
|
|
{
|
|
return m_State;
|
|
}
|
|
void Writer_statistics::setState(std::string const& value)
|
|
{
|
|
m_State = value;
|
|
m_StateIsSet = true;
|
|
}
|
|
bool Writer_statistics::stateIsSet() const
|
|
{
|
|
return m_StateIsSet;
|
|
}
|
|
void Writer_statistics::unsetState()
|
|
{
|
|
m_StateIsSet = false;
|
|
}
|
|
|
|
|
|
} // namespace org::openapitools::server::model
|
|
|