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


C++ Plugin::GetPlugin方法代码示例

本文整理汇总了C++中Plugin::GetPlugin方法的典型用法代码示例。如果您正苦于以下问题:C++ Plugin::GetPlugin方法的具体用法?C++ Plugin::GetPlugin怎么用?C++ Plugin::GetPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plugin的用法示例。


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

示例1: if

  /**
   * Create an AtmosModel object using a PVL specification.
   * An example of the PVL required for this is:
   *
   * @code
   * Object = AtmosphericModel
   *   Group = Algorithm
   *     # Use 'AtmName' instead of 'Name' if using the Gui combo box
   *     # for unique Pvl keyword in DefFile
   *     AtmName/Name = Isotropic1
   *     Tau = 0.7
   *     Tauref = 0.0
   *     Wha = 0.5
   *     Hnorm = 0.003
   *     Nulneg = NO
   *   EndGroup
   * EndObject
   * @endcode
   *
   * There are many other options that can be set via the pvl and are
   * described in other documentation (see below).
   *
   * @param pvl The pvl object containing the specification
   * @param pmodel The PhotoModel objects contining the data
   *
   * @return A pointer to the new AtmosModel
   *
   * @see atmosphericModels.doc
   **/
  AtmosModel *AtmosModelFactory::Create(Pvl &pvl, PhotoModel &pmodel) {

    // Get the algorithm name to create
    PvlGroup &algo = pvl.findObject("AtmosphericModel")
                     .findGroup("Algorithm", Pvl::Traverse);

    QString algorithm = "";
    if(algo.hasKeyword("AtmName")) {
      algorithm = QString(algo["AtmName"]);
    }
    else if(algo.hasKeyword("Name")) {
      algorithm = QString(algo["Name"]);
    }
    else {
      QString msg = "Keyword [Name] or keyword [AtmName] must ";
      msg += "exist in [Group = Algorithm]";
      throw IException(IException::User, msg, _FILEINFO_);
    }

    // Open the factory plugin file
    Plugin *p = new Plugin;
    FileName f("AtmosModel.plugin");
    if(f.fileExists()) {
      p->read("AtmosModel.plugin");
    }
    else {
      p->read("$ISISROOT/lib/AtmosModel.plugin");
    }

    // Get the algorithm specific plugin and return it
    AtmosModel * (*plugin)(Pvl & pvl, PhotoModel & pmodel);
    plugin = (AtmosModel * ( *)(Pvl & pvl, PhotoModel & pmodel))
             p->GetPlugin(algorithm);
    return (*plugin)(pvl, pmodel);
  }
开发者ID:corburn,项目名称:ISIS,代码行数:64,代码来源:AtmosModelFactory.cpp

示例2: f

  /** 
   * Create an InterestOperator object using a PVL specification.
   * An example of the PVL required for this is:
   * 
   * @code
   * Object = InterestOperator
   *   Group = Operator
   *     Name      = StandardDeviation
   *     Samples   = 21
   *     Lines     = 21
   *     Delta     = 50
   *   EndGroup
   * EndObject
   * @endcode
   * 
   * There are many other options that can be set via the pvl and are
   * described in other documentation (see below).
   * 
   * @param pvl The pvl object containing the specification
   * 
   * @see automaticRegistration.doc
   **/
  InterestOperator *InterestOperatorFactory::Create(Pvl &pvl) {
    // Get the algorithm name to create
    PvlGroup &op = pvl.FindGroup("Operator",Pvl::Traverse);
    std::string operatorName = op["Name"];

    // Open the factory plugin file
    Plugin p;
    Filename f("InterestOperator.plugin");
    if (f.Exists()) {
      p.Read("InterestOperator.plugin");
    }
    else {
      p.Read("$ISISROOT/lib/InterestOperator.plugin");
    }

    // Get the algorithm specific plugin and return it
    InterestOperator * (*plugin) (Pvl &pvl);
    plugin = (InterestOperator * (*)(Pvl &pvl)) p.GetPlugin(operatorName);
    return (*plugin)(pvl);
  }
开发者ID:assutech,项目名称:isis3,代码行数:42,代码来源:InterestOperatorFactory.cpp


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