コード例 #1
0
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; 
}
コード例 #2
0
ファイル: GasMixture.cpp プロジェクト: ORNL-BTRIC/OpenStudio
  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;
  }
コード例 #3
0
//-----------------------------------------------------------------------------
// 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);
}
コード例 #4
0
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;
}
コード例 #5
0
ファイル: String.cpp プロジェクト: 0xbda2d2f8/FreeNOS
Size String::set(long number, Number::Base base, char *string)
{
    return setUnsigned((ulong) number, base, string, true);
}
コード例 #6
0
VariantValue::VariantValue(unsigned Unsigned) : Type(VT_Nothing) {
  setUnsigned(Unsigned);
}
コード例 #7
0
 bool RunPeriodControlSpecialDays_Impl::setDuration(unsigned duration)
 {
   return setUnsigned(OS_RunPeriodControl_SpecialDaysFields::Duration, duration);
 }