示例#1
0
  void RefrigerationSystem_Impl::removeAllTemplate( boost::optional<ModelObjectList>& modelObjectList ) {
    if( modelObjectList ) {
      std::vector<ModelObject> modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          boost::optional<T> modelObject = elem.optionalCast<T>();
          if (modelObject) {
            modelObjectList->removeModelObject(elem);
          }
      }
    }  
  }
示例#2
0
  std::vector<T> RefrigerationSystem_Impl::listTemplate( const boost::optional<ModelObjectList>& modelObjectList ) const {
    std::vector<T> result;

    if( modelObjectList ) {
      std::vector<ModelObject> modelObjects = modelObjectList->modelObjects();

      for(const auto & elem : modelObjects) {
          boost::optional<T> modelObject = elem.optionalCast<T>();
          if (modelObject) {
            result.push_back(modelObject.get());
          }
      }
    }

    return result;
  }