bool ClimateZone::setType(const std::string& institution, const std::string& documentName, unsigned year) { bool result = setString(OS_ClimateZonesExtensibleFields::ClimateZoneInstitutionName,institution); result = result && setString(OS_ClimateZonesExtensibleFields::ClimateZoneDocumentName,documentName); result = result && setUnsigned(OS_ClimateZonesExtensibleFields::ClimateZoneDocumentYear,year); return result; }
bool GasMixture_Impl::addGas(const std::string& type, double fraction) { if (numGases() == 4) { LOG(Info,"Cannot add any more gases to GasMixture " << briefDescription() << "."); return false; } unsigned index = numGases(); bool ok = setUnsigned(OS_WindowMaterial_GasMixtureFields::NumberofGasesinMixture,index + 1); OS_ASSERT(ok); bool result = setGas(index,type,fraction); if (!result) { ok = setUnsigned(OS_WindowMaterial_GasMixtureFields::NumberofGasesinMixture,index); OS_ASSERT(ok); } return result; }
//----------------------------------------------------------------------------- // sets the checksum out of the binary data, // buffer and packetLength must be correctly initialised void CCSDS::PACKET::Packet::setChecksum() throw(UTIL::Exception) //----------------------------------------------------------------------------- { if(!checkPacketLength()) { throw UTIL::Exception("inconsistent packetLength"); } size_t crcPos = bufferSize() - 2; uint16_t crc = UTIL::CRC::calculate16(buffer(), crcPos); setUnsigned(crcPos, 2, crc); }
VariantValue &VariantValue::operator=(const VariantValue &Other) { if (this == &Other) return *this; reset(); switch (Other.Type) { case VT_Unsigned: setUnsigned(Other.getUnsigned()); break; case VT_String: setString(Other.getString()); break; case VT_Matcher: setMatcher(Other.getMatcher()); break; case VT_Nothing: Type = VT_Nothing; break; } return *this; }
Size String::set(long number, Number::Base base, char *string) { return setUnsigned((ulong) number, base, string, true); }
VariantValue::VariantValue(unsigned Unsigned) : Type(VT_Nothing) { setUnsigned(Unsigned); }
bool RunPeriodControlSpecialDays_Impl::setDuration(unsigned duration) { return setUnsigned(OS_RunPeriodControl_SpecialDaysFields::Duration, duration); }