本文整理汇总了C++中boost::optional::valueName方法的典型用法代码示例。如果您正苦于以下问题:C++ optional::valueName方法的具体用法?C++ optional::valueName怎么用?C++ optional::valueName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::optional
的用法示例。
在下文中一共展示了optional::valueName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CalibrationUtilityBill::CalibrationUtilityBill(const std::string& name, const FuelType& fuelType, const InstallLocationType& meterInstallLocation,
boost::optional<std::string> meterSpecificInstallLocation, boost::optional<EndUseCategoryType> meterEndUseCategory,
boost::optional<std::string> meterSpecificEndUse, std::string consumptionUnit, double consumptionUnitConversionFactor,
boost::optional<std::string> peakDemandUnit, boost::optional<double> peakDemandUnitConversionFactor,
boost::optional<unsigned> timestepsInPeakDemandWindow, boost::optional<double> minutesInPeakDemandWindow,
boost::optional<unsigned> numberBillingPeriodsInCalculations, boost::optional<double> CVRMSE, boost::optional<double> NMBE)
: m_attribute(CalibrationUtilityBill::attributeName(), std::vector<openstudio::Attribute>(), boost::none)
{
std::vector<Attribute> values;
values.push_back(Attribute("name", name));
values.push_back(Attribute("fuelType", fuelType.valueName()));
values.push_back(Attribute("meterInstallLocation", meterInstallLocation.valueName()));
if (meterSpecificInstallLocation){
values.push_back(Attribute("meterSpecificInstallLocation", *meterSpecificInstallLocation));
}
if (meterEndUseCategory){
values.push_back(Attribute("meterEndUseCategory", meterEndUseCategory->valueName()));
}
if (meterSpecificEndUse){
values.push_back(Attribute("meterSpecificEndUse", *meterSpecificEndUse));
}
values.push_back(Attribute("consumptionUnit", consumptionUnit));
values.push_back(Attribute("consumptionUnitConversionFactor", consumptionUnitConversionFactor));
if (peakDemandUnit){
values.push_back(Attribute("peakDemandUnit", *peakDemandUnit));
}
if (peakDemandUnitConversionFactor){
values.push_back(Attribute("peakDemandUnitConversionFactor", *peakDemandUnitConversionFactor));
}
if (timestepsInPeakDemandWindow){
values.push_back(Attribute("timestepsInPeakDemandWindow", *timestepsInPeakDemandWindow));
}
if (minutesInPeakDemandWindow){
values.push_back(Attribute("minutesInPeakDemandWindow", *minutesInPeakDemandWindow));
}
if (numberBillingPeriodsInCalculations){
values.push_back(Attribute("numberBillingPeriodsInCalculations", *numberBillingPeriodsInCalculations));
}
if (CVRMSE){
values.push_back(Attribute("cvrmse", *CVRMSE));
}
if (NMBE){
values.push_back(Attribute("nmbe", *NMBE));
}
values.push_back(Attribute("billingPeriods", std::vector<Attribute>()));
m_attribute.setValue(values);
}