当前位置: 首页>>代码示例>>C++>>正文


C++ ParentObject类代码示例

本文整理汇总了C++中ParentObject的典型用法代码示例。如果您正苦于以下问题:C++ ParentObject类的具体用法?C++ ParentObject怎么用?C++ ParentObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ParentObject类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setParent

 // set the parent, child may have to call methods on the parent
 bool InsideSurfaceConvectionAlgorithm_Impl::setParent(ParentObject& newParent)
 {
   if (newParent.optionalCast<SimulationControl>() && (newParent.model() == model())) {
     return true;
   }
   return false;
 }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:InsideSurfaceConvectionAlgorithm.cpp

示例2: setParent

 bool ConvergenceLimits_Impl::setParent(ParentObject& newParent)
 {
   if (newParent.optionalCast<SimulationControl>() && (newParent.model() == model())) {
     return true;
   }
   return false;
 }
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:7,代码来源:ConvergenceLimits.cpp

示例3: setParent

 // set the parent, child may have to call methods on the parent
 bool RunPeriod_Impl::setParent(ParentObject& newParent)
 {
   if (newParent.optionalCast<SimulationControl>() && (newParent.model() == model())) {
     return true;
   }
   return false;
 }
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:8,代码来源:RunPeriod.cpp

示例4: setParent

 bool WeatherFile_Impl::setParent(ParentObject& newParent)
 {
   if (newParent.optionalCast<Site>() && (newParent.model() == model())){
     return true;
   }
   return false;
 }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:7,代码来源:WeatherFile.cpp

示例5: setParent

 // set the parent, child may have to call methods on the parent
 bool SizingPeriod_Impl::setParent(ParentObject& newParent)
 {
   if (newParent.optionalCast<Site>() && (newParent.model() == model())) {
     return true;
   }
   return false;
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:8,代码来源:SizingPeriod.cpp

示例6: setParent

 // set the parent, child may have to call methods on the parent
 bool HeatBalanceAlgorithm_Impl::setParent(ParentObject& newParent)
 {
   if (newParent.optionalCast<SimulationControl>() && (newParent.model() == model())) {
     return true;
   }
   return false;
 }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:8,代码来源:HeatBalanceAlgorithm.cpp

示例7: setParent

// set the parent, child may have to call methods on the parent
bool ZoneAirContaminantBalance_Impl::setParent(ParentObject& newParent)
{
    if (newParent.optionalCast<SimulationControl>() && (newParent.model() == model())) {
        return true;
    }
    return false;
}
开发者ID:JackTing,项目名称:OpenStudio,代码行数:8,代码来源:ZoneAirContaminantBalance.cpp

示例8: setParent

 // set the parent, child may have to call methods on the parent
 bool RunPeriodControlSpecialDays_Impl::setParent(ParentObject& newParent)
 {
   if (newParent.optionalCast<YearDescription>() && (newParent.model() == model())) {
     return true;
   }
   return false;
 }
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:8,代码来源:RunPeriodControlSpecialDays.cpp

示例9: setParent

 bool ScheduleRule_Impl::setParent(ParentObject& newParent)
 {
   bool result = false;
   if (newParent.optionalCast<ScheduleRuleset>()){
     result = setPointer(OS_Schedule_RuleFields::ScheduleRulesetName, newParent.handle());
   }
   return result;
 }
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:8,代码来源:ScheduleRule.cpp

示例10: setParent

 bool ScheduleDay_Impl::setParent(ParentObject& newParent) {
   if (OptionalScheduleRule scheduleRule = newParent.optionalCast<ScheduleRule>()) {
     if (getObject<ScheduleDay>().getModelObjectSources<ModelObject>().empty()) {
       bool result = newParent.setPointer(OS_Schedule_RuleFields::DayScheduleName, handle());
       OS_ASSERT(result);
       return true;
     }
   }
   return false;
 }
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:10,代码来源:ScheduleDay.cpp

示例11: getRecursiveChildren

std::vector<ModelObject> getRecursiveChildren(const ParentObject& object, bool includeLifeCycleCosts) {
  std::set<Handle> resultSet;
  std::pair<HandleSet::const_iterator,bool> insertResult;
  std::vector<ModelObject> result;
  resultSet.insert(object.handle());
  result.push_back(object);

  if (includeLifeCycleCosts){
    for (const LifeCycleCost& lifeCycleCost : object.lifeCycleCosts()){
      result.push_back(lifeCycleCost);
    }
  }

  std::deque<ParentObject> parents;
  parents.push_back(object);

  while (parents.size() > 0) {
    ParentObject currentParent(parents[0]);
    parents.pop_front();

    // parent's costs have already been added
    
    for (const ModelObject& child : currentParent.children()) {
      insertResult = resultSet.insert(child.handle());
      if (insertResult.second) {
        result.push_back(child);

        if (includeLifeCycleCosts){
          for (const LifeCycleCost& lifeCycleCost : child.lifeCycleCosts()){
            result.push_back(lifeCycleCost);
          }
        }

        OptionalParentObject opo = child.optionalCast<ParentObject>();
        if (opo) { 
          parents.push_back(*opo); 
        }
      }
    }
  }

  return result;
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:43,代码来源:ParentObject.cpp

示例12: setParent

 bool ClimateZones_Impl::setParent(ParentObject& newParent) {
   if ( newParent.optionalCast<Site>() && (newParent.model() == model()) ){
     return true;
   }
   return false;
 }
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:6,代码来源:ClimateZones.cpp


注:本文中的ParentObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。