本文整理汇总了C++中People::name方法的典型用法代码示例。如果您正苦于以下问题:C++ People::name方法的具体用法?C++ People::name怎么用?C++ People::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertNewPeople
/**
* @brief Adds a person to the database.
* Should not be called directly.
*
* @param People
* @return bool
*/
bool DatabaseManager::insertNewPeople(People &people)
{
QSqlQuery l_query(m_db);
// If a people with the same name exist, we update it
// else we insert
if(existPeople(people.name())) {
Macaw::DEBUG("[DatabaseManager.insertNewPeople] Name already known");
People l_peopleToUpdate = getOnePeopleByName(people.name());
people.setId(l_peopleToUpdate.id());
if(!updatePeople(people)) {
return false;
}
} else {
l_query.prepare("INSERT INTO people ("
"name, "
"birthday, "
"biography, "
"imported, "
"id_tmdb "
") VALUES ("
":name, "
":birthday, "
":biography, "
":imported, "
":id_tmdb "
")"
);
l_query.bindValue(":name", people.name());
l_query.bindValue(":birthday", people.birthday().toString(DATE_FORMAT));
l_query.bindValue(":biography", people.biography());
l_query.bindValue(":imported", people.isImported());
l_query.bindValue(":id_tmdb", people.tmdbId());
if (!l_query.exec()) {
Macaw::DEBUG("In insertNewPeople():");
Macaw::DEBUG(l_query.lastError().text());
return false;
}
people.setId(l_query.lastInsertId().toInt());
}
return true;
}
示例2:
bool People::operator== (const People &other)
{
if ( this->id() == other.id() &&
this->name() == other.name() &&
this->birthday() == other.birthday() &&
this->biography() == other.biography() &&
this->type() == other.type() )
{
return true;
}
return false;
}
示例3: idfObject
boost::optional<IdfObject> ForwardTranslator::translatePeople( People & modelObject )
{
IdfObject idfObject(openstudio::IddObjectType::People);
m_idfObjects.push_back(idfObject);
for (LifeCycleCost lifeCycleCost : modelObject.lifeCycleCosts()){
translateAndMapModelObject(lifeCycleCost);
}
PeopleDefinition definition = modelObject.peopleDefinition();
idfObject.setString(PeopleFields::Name, modelObject.name().get());
boost::optional<Space> space = modelObject.space();
boost::optional<SpaceType> spaceType = modelObject.spaceType();
if (space){
boost::optional<ThermalZone> thermalZone = space->thermalZone();
if (thermalZone){
idfObject.setString(PeopleFields::ZoneorZoneListName, thermalZone->name().get());
}
}else if(spaceType){
idfObject.setString(PeopleFields::ZoneorZoneListName, spaceType->name().get());
}
boost::optional<Schedule> schedule = modelObject.numberofPeopleSchedule();
if (schedule){
idfObject.setString(PeopleFields::NumberofPeopleScheduleName, schedule->name().get());
}
idfObject.setString(PeopleFields::NumberofPeopleCalculationMethod, definition.numberofPeopleCalculationMethod());
double multiplier = modelObject.multiplier();
OptionalDouble d = definition.numberofPeople();
if (d){
idfObject.setDouble(PeopleFields::NumberofPeople, (*d)*multiplier);
}
d = definition.peopleperSpaceFloorArea();
if (d){
idfObject.setDouble(PeopleFields::PeopleperZoneFloorArea, (*d)*multiplier);
}
d = definition.spaceFloorAreaperPerson();
if (d){
idfObject.setDouble(PeopleFields::ZoneFloorAreaperPerson, (*d)*multiplier);
}
d = definition.fractionRadiant();
if (d){
idfObject.setDouble(PeopleFields::FractionRadiant, *d);
}
d = definition.sensibleHeatFraction();
if (d){
idfObject.setDouble(PeopleFields::SensibleHeatFraction, *d);
}
schedule = modelObject.activityLevelSchedule();
if (schedule){
idfObject.setString(PeopleFields::ActivityLevelScheduleName, schedule->name().get());
}
if (!definition.isCarbonDioxideGenerationRateDefaulted()){
idfObject.setDouble(PeopleFields::CarbonDioxideGenerationRate, definition.carbonDioxideGenerationRate());
}
if (!definition.isEnableASHRAE55ComfortWarningsDefaulted()){
if (definition.enableASHRAE55ComfortWarnings()){
idfObject.setString(PeopleFields::EnableASHRAE55ComfortWarnings, "Yes");
}else{
idfObject.setString(PeopleFields::EnableASHRAE55ComfortWarnings, "No");
}
}
if (!definition.isMeanRadiantTemperatureCalculationTypeDefaulted()){
idfObject.setString(PeopleFields::MeanRadiantTemperatureCalculationType, definition.meanRadiantTemperatureCalculationType());
}
// TODO: Surface Name/Angle Factor List Name
schedule = modelObject.workEfficiencySchedule();
if (schedule){
idfObject.setString(PeopleFields::WorkEfficiencyScheduleName, schedule->name().get());
}
schedule = modelObject.clothingInsulationSchedule();
if (schedule){
idfObject.setString(PeopleFields::ClothingInsulationScheduleName, schedule->name().get());
}
schedule = modelObject.airVelocitySchedule();
if (schedule){
idfObject.setString(PeopleFields::AirVelocityScheduleName, schedule->name().get());
}
for (int i = 0, n = definition.numThermalComfortModelTypes(); i < n; ++i) {
OptionalString s = definition.getThermalComfortModelType(i);
if (s) {
idfObject.pushExtensibleGroup(StringVector(1u,*s));
//.........这里部分代码省略.........