• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cname函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sl

  std::vector<MetaObject::CompatibleMethod> MetaObjectPrivate::findCompatibleMethod(const std::string &nameOrSignature)
  {
    boost::recursive_mutex::scoped_lock sl(_methodsMutex);
    std::vector<MetaObject::CompatibleMethod>         ret;
    std::string cname(nameOrSignature);

    //no signature specified fallback on findMethod
    if (cname.find(':') == std::string::npos)
    {
      std::vector<MetaMethod> r = findMethod(cname);
      ret.reserve(r.size());
      for (unsigned i=0; i<r.size(); ++i)
        ret.push_back(std::make_pair(r[i], 1.0f));
      return ret;
    }

    std::vector<std::string> sigsorig = qi::signatureSplit(nameOrSignature);
    if (sigsorig[1].empty())
      return ret;

    Signature sresolved(sigsorig[2]);

    for (auto& method: _methods) {
      const qi::MetaMethod& mm = method.second;

      if (sigsorig[1] != mm.name())
        continue;
      float score = sresolved.isConvertibleTo(Signature(mm.parametersSignature()));
      if (score)
        ret.push_back(std::make_pair(mm, score));
    }
    return ret;
  }
开发者ID:dmerejkowsky,项目名称:libqi,代码行数:33,代码来源:metaobject.cpp


示例2: xmlStrEqual

bool OrbitalConstraintsBase::getVariables(xmlNodePtr cur)
{
  xmlChar* prnode=xmlGetProp(cur,(const xmlChar*)"print");
  if(prnode != NULL)
  {
    PrintTables = xmlStrEqual(prnode,(const xmlChar*)"yes");
  }
  //save the xml node
  myNode=cur;
  cur = cur->children;
  while(cur != NULL)
  {
    string cname((const char*)(cur->name));
    if(cname == "correlation")
    {
      xmlNodePtr cur1=cur->children;
      while(cur1 != NULL)
      {
        string cname1((const char*)(cur1->name));
        if(cname1 == "parameter")
        {
          getParam(cur1);
        }
        cur1=cur1->next;
      }
    }
    else
      if(cname == "parameter")
      {
        getParam(cur);
      }
    cur = cur->next;
  } // while cur
  return true;
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:35,代码来源:OrbitalConstraintsBase.cpp


示例3: main

int main(int argc, char **argv)
{
    int reti;
    uint16_t vid;
    struct vol *vol;
    struct dir *retdir;
    struct path *path;

    /* initialize */
    printf("Initializing\n============\n");
    TEST(setuplog("default:note","/dev/tty"));

    TEST( afp_options_parse_cmdline(&obj, 3, &args[0]) );

    TEST_int( afp_config_parse(&obj, NULL), 0);
    TEST_int( configinit(&obj), 0);
    TEST( cnid_init() );
    TEST( load_volumes(&obj, NULL) );
    TEST_int( dircache_init(8192), 0);
    obj.afp_version = 32;

    printf("\n");

    /* now run tests */
    printf("Running tests\n=============\n");

    TEST_expr(vid = openvol(&obj, "test"), vid != 0);
    TEST_expr(vol = getvolbyvid(vid), vol != NULL);

    /* test directory.c stuff */
    TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT_PARENT), retdir != NULL);
    TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT), retdir != NULL);
    TEST_expr(path = cname(vol, retdir, cnamewrap("Network Trash Folder")), path != NULL);

    TEST_expr(retdir = dirlookup(vol, DIRDID_ROOT), retdir != NULL);
    TEST_int(getfiledirparms(&obj, vid, DIRDID_ROOT_PARENT, "test"), 0);
    TEST_int(getfiledirparms(&obj, vid, DIRDID_ROOT, ""), 0);

    TEST_expr(reti = createdir(&obj, vid, DIRDID_ROOT, "dir1"),
              reti == 0 || reti == AFPERR_EXIST);

    TEST_int(getfiledirparms(&obj, vid, DIRDID_ROOT, "dir1"), 0);
/*
  FIXME: this doesn't work although it should. "//" get translated to \000 \000 at means ".."
  ie this should getfiledirparms for DIRDID_ROOT_PARENT -- at least afair!
    TEST_int(getfiledirparms(&configs->obj, vid, DIRDID_ROOT, "//"), 0);
*/
    TEST_int(createfile(&obj, vid, DIRDID_ROOT, "dir1/file1"), 0);
    TEST_int(delete(&obj, vid, DIRDID_ROOT, "dir1/file1"), 0);
    TEST_int(delete(&obj, vid, DIRDID_ROOT, "dir1"), 0);

    TEST_int(createfile(&obj, vid, DIRDID_ROOT, "file1"), 0);
    TEST_int(getfiledirparms(&obj, vid, DIRDID_ROOT, "file1"), 0);
    TEST_int(delete(&obj, vid, DIRDID_ROOT, "file1"), 0);


    /* test enumerate.c stuff */
    TEST_int(enumerate(&obj, vid, DIRDID_ROOT), 0);
}
开发者ID:NTmatter,项目名称:Netatalk,代码行数:59,代码来源:test.c


示例4: getDXFColorName

// A helper function to create a color name acceptable in DXF files
// DXF files do not use a RGB definition
static wxString getDXFColorName( COLOR4D aColor )
{
    EDA_COLOR_T color = ColorFindNearest( int( aColor.r*255 ),
                                          int( aColor.g*255 ),
                                          int( aColor.b*255 ) );
    wxString cname( dxf_layer[color].name );
    return cname;
}
开发者ID:Lotharyx,项目名称:kicad-source-mirror,代码行数:10,代码来源:DXF_plotter.cpp


示例5: pln_newlanding

void
pln_newlanding(struct emp_qelem *list, coord tx, coord ty, int cno)
{
    struct emp_qelem *qp;
    struct plist *plp;
    struct shpstr ship;
    struct sctstr sect;

    if (cno >= 0)
	getship(cno, &ship);
    for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
	plp = (struct plist *)qp;
	if (cno >= 0) {
	    if (!could_be_on_ship(&plp->plane, &ship))
		pr("\t%s cannot land on ship #%d! %s aborts!\n",
		   prplane(&plp->plane), cno, prplane(&plp->plane));
	    else if (!put_plane_on_ship(&plp->plane, &ship))
		pr("\tNo room on ship #%d! %s aborts!\n",
		   cno, prplane(&plp->plane));
	    else {
		if (plp->plane.pln_own != ship.shp_own) {
		    wu(0, ship.shp_own, "%s %s lands on your %s\n",
		       cname(player->cnum), prplane(&plp->plane),
		       prship(&ship));
		}
		if (plp->pcp->pl_crew && plp->pstage == PLG_INFECT
		    && ship.shp_pstage == PLG_HEALTHY)
		    ship.shp_pstage = PLG_EXPOSED;
	    }
	} else {
	    plp->plane.pln_x = tx;
	    plp->plane.pln_y = ty;
	    getsect(tx, ty, &sect);
	    if (plp->plane.pln_own != sect.sct_own) {
		wu(0, sect.sct_own,
		   "%s %s lands at your sector %s\n",
		   cname(player->cnum),
		   prplane(&plp->plane), xyas(tx, ty, sect.sct_own));
	    }
	    if (plp->pcp->pl_crew && plp->pstage == PLG_INFECT
		&& sect.sct_pstage == PLG_HEALTHY)
		sect.sct_pstage = PLG_EXPOSED;
	    plp->plane.pln_ship = cno;
	}
    }
}
开发者ID:fstltna,项目名称:empserver,代码行数:46,代码来源:plnsub.c


示例6: cname

CIMValue CIMHelper::getPropertyValue(const CIMInstance &instanceObject, String name)
{
    CIMName cname(name);
    Uint32 index = instanceObject.findProperty(cname);
    if (index == PEG_NOT_FOUND) return CIMValue();
    CIMConstProperty property = instanceObject.getProperty(index);
    return property.getValue();
}
开发者ID:brunolauze,项目名称:pegasus-providers,代码行数:8,代码来源:CIMHelper.cpp


示例7: getDatabase

//! reads checks info from database
void Table::loadCheckConstraints()
{
    if (checkConstraintsLoadedM)
        return;
    checkConstraintsM.clear();

    DatabasePtr db = getDatabase();
    wxMBConv* conv = db->getCharsetConverter();
    MetadataLoader* loader = db->getMetadataLoader();
    // first start a transaction for metadata loading, then lock the table
    // when objects go out of scope and are destroyed, table will be unlocked
    // before the transaction is committed - any update() calls on observers
    // can possibly use the same transaction
    MetadataLoaderTransaction tr(loader);
    SubjectLocker lock(this);

    IBPP::Statement& st1 = loader->getStatement(
        "select r.rdb$constraint_name, t.rdb$trigger_source, d.rdb$field_name "
        " from rdb$relation_constraints r "
        " join rdb$check_constraints c on r.rdb$constraint_name=c.rdb$constraint_name and r.rdb$constraint_type = 'CHECK'"
        " join rdb$triggers t on c.rdb$trigger_name=t.rdb$trigger_name and t.rdb$trigger_type = 1 "
        " left join rdb$dependencies d on t.rdb$trigger_name = d.rdb$dependent_name "
        "      and d.rdb$depended_on_name = r.rdb$relation_name "
        "      and d.rdb$depended_on_type = 0 "
        " where r.rdb$relation_name=? "
        " order by 1 "
    );

    st1->Set(1, wx2std(getName_(), conv));
    st1->Execute();
    CheckConstraint *cc = 0;
    while (st1->Fetch())
    {
        std::string s;
        st1->Get(1, s);
        wxString cname(std2wxIdentifier(s, conv));
        if (!cc || cname != cc->getName_()) // new constraint
        {
            wxString source;
            readBlob(st1, 2, source, conv);

            CheckConstraint c;
            c.setParent(this);
            c.setName_(cname);
            c.sourceM = source;
            checkConstraintsM.push_back(c);
            cc = &checkConstraintsM.back();
        }

        if (!st1->IsNull(3))
        {
            st1->Get(3, s);
            wxString fname(std2wxIdentifier(s, conv));
            cc->columnsM.push_back(fname);
        }
    }
    checkConstraintsLoadedM = true;
}
开发者ID:DragonZX,项目名称:flamerobin,代码行数:59,代码来源:table.cpp


示例8: blockSignals

void
QvisSubsetPanelWidget::ViewCollection(int id)
{
    avtSILRestriction_p restriction = viewerProxy->GetPlotSILRestriction();
    avtSILCollection_p collection = restriction->GetSILCollection(id);
    numCheckable = 0;
    numChecked = 0;
    tree->clear();

    if(*collection != NULL)
    {
        tree->setEnabled(true);
        blockSignals(true);
          
        SetTitle(collection->GetCategory().c_str());
        const avtSILNamespace *ns = collection->GetSubsets();
        int numElems = ns->GetNumberOfElements();

        avtSILRestrictionTraverser trav(restriction);
        for(int i = 0; i < numElems; ++i)
        {
            int setIdx = ns->GetElement(i);
            avtSILSet_p set = restriction->GetSILSet(setIdx);

            // Create an item for the set and set its checked value.
            CheckedState s = S2S(trav.UsesSetData(setIdx));
            QString cname(set->GetName().c_str());
            QvisSubsetPanelItem *item = new QvisSubsetPanelItem(tree,
                                                                cname,
                                                                s,
                                                                setIdx);
            numCheckable++;

            if(s == CompletelyChecked)
                numChecked++;
            
            // Add all of the collections that come out of the set. Note that
            // they are added as uncheckable items.
            QvisSubsetPanelItem *cItem = NULL;
            const std::vector<int> &mapsOut = set->GetMapsOut();
            for(size_t j = 0; j < mapsOut.size(); ++j)
            {
                int cIndex = mapsOut[j];

                avtSILCollection_p c = restriction->GetSILCollection(cIndex);
                QString collectionName(c->GetCategory().c_str());
                cItem = new QvisSubsetPanelItem(item,
                                                collectionName,
                                                cIndex);
            }
        }
        blockSignals(false);
    }
    EnableButtons(true);
    
    
}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:57,代码来源:QvisSubsetPanelWidget.C


示例9: repo_enabled

/* helpers */
static PyObject *
repo_enabled(_SackObject *self, PyObject *reponame, int enabled)
{
    PycompString cname(reponame);
    if (!cname.getCString())
        return NULL;
    dnf_sack_repo_enabled(self->sack, cname.getCString(), enabled);
    Py_RETURN_NONE;
}
开发者ID:rpm-software-management,项目名称:libhif,代码行数:10,代码来源:sack-py.cpp


示例10: while

  bool AGPDeterminantBuilder::createAGP(BasisBuilderT *abuilder, xmlNodePtr cur) {
    bool spinpolarized=false;
    typename BasisBuilderT::BasisSetType *basisSet=0;
    cur = cur->xmlChildrenNode;
    while(cur != NULL) {
      string cname((const char*)(cur->name));
      if(cname == basisset_tag) {
        basisSet = abuilder->addBasisSet(cur);
        if(!basisSet) return false;
      } else if(cname == "coefficient" || cname == "coefficients") {
        if(agpDet == 0) {
          int nup=targetPtcl.first(1), ndown=0;
          if(targetPtcl.groups()>1) ndown = targetPtcl.first(2)-nup;
          basisSet->resize(nup+ndown);
          agpDet = new AGPDeterminant(basisSet);
          agpDet->resize(nup,ndown);
        }
        int offset=1;
        xmlNodePtr tcur=cur->xmlChildrenNode;
        while(tcur != NULL) {
          if(xmlStrEqual(tcur->name,(const xmlChar*)"lambda")) {
            int i=atoi((const char*)(xmlGetProp(tcur,(const xmlChar*)"i")));
            int j=atoi((const char*)(xmlGetProp(tcur,(const xmlChar*)"j")));
            double c=atof((const char*)(xmlGetProp(tcur,(const xmlChar*)"c")));
            agpDet->Lambda(i-offset,j-offset)=c;
            if(i != j) {
              agpDet->Lambda(j-offset,i-offset)=c;
            }
          }
          tcur=tcur->next;
        }
      } else if(cname == "unpaired") {
        spinpolarized=true;
        int offset=1;
        xmlNodePtr tcur=cur->xmlChildrenNode;
        while(tcur != NULL) {
          if(xmlStrEqual(tcur->name,(const xmlChar*)"lambda")) {
            int i=atoi((const char*)(xmlGetProp(tcur,(const xmlChar*)"i")));
            int j=atoi((const char*)(xmlGetProp(tcur,(const xmlChar*)"j")));
            double c=atof((const char*)(xmlGetProp(tcur,(const xmlChar*)"c")));
            agpDet->LambdaUP(j-offset,i-offset)=c;
          }
          tcur=tcur->next;
        }

      }
      cur=cur->next;
    }

    //app_log() << agpDet->Lambda << endl;
    if(spinpolarized) {
      app_log() << "  Coefficients for the unpaired electrons " << endl;
      app_log() << agpDet->LambdaUP << endl;
    }
    return true;
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:56,代码来源:AGPDeterminantBuilder.cpp


示例11: while

  void ECPotentialBuilder::useXmlFormat(xmlNodePtr cur) {

    cur=cur->children;
    while(cur != NULL) {
      string cname((const char*)cur->name);
      if(cname == "pseudo") {
        string href("none");
        string ionName("none");
        string format("xml");
        //RealType rc(2.0);//use 2 Bohr
        OhmmsAttributeSet hAttrib;
        hAttrib.add(href,"href");
        hAttrib.add(ionName,"elementType"); hAttrib.add(ionName,"symbol");
        hAttrib.add(format,"format");
        //hAttrib.add(rc,"cutoff");
        hAttrib.put(cur);

        int speciesIndex=IonConfig.getSpeciesSet().findSpecies(ionName);
        if(speciesIndex < IonConfig.getSpeciesSet().getTotalNum()) {
          app_log() << endl << "  Adding pseudopotential for " << ionName << endl;
          ECPComponentBuilder ecp(ionName);
          bool success=false;
          if(format == "xml") {
            if(href == "none") {
              success=ecp.put(cur);
            } else {
              success=ecp.parse(href,cur);
            }
          } 
          else if(format == "casino")
          {
            //success=ecp.parseCasino(href,rc);
            success=ecp.parseCasino(href,cur);
          }

          if(success) {
#if !defined(HAVE_MPI)
            ecp.printECPTable();
#endif
            if(ecp.pp_loc) {
              localPot[speciesIndex]=ecp.pp_loc;
              localZeff[speciesIndex]=ecp.Zeff;
              hasLocalPot=true;
            }
            if(ecp.pp_nonloc) {
              nonLocalPot[speciesIndex]=ecp.pp_nonloc;
              hasNonLocalPot=true;
            }
          }
        } else {
          app_error() << "  Ion species " << ionName << " is not found." << endl;
        }
      } 
      cur=cur->next;
    }
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:56,代码来源:ECPotentialBuilder.cpp


示例12: printAllCanvases

//--- Print all created canvasses ---
void printAllCanvases(const char* folder="plots")
{
   TSeqCollection * sc = dynamic_cast<TSeqCollection*>(gROOT->GetListOfCanvases());
   for (int i =0; i<sc->GetSize(); ++i) {
      TCanvas * c = dynamic_cast<TCanvas*>(sc->At(i));
      TString cname(c->GetName());
      printf("Canvas: %s/%s.gif\n",folder,cname.Data());
      c->Print(Form("%s/%s.gif",folder,cname.Data()));
   }
}
开发者ID:CmsHI,项目名称:CVS_SavedFMa,代码行数:11,代码来源:savedfrankTools.C


示例13: ThisBasisSetType

    void JastrowBasisBuilder::createLocalizedBasisSet(xmlNodePtr cur)
  {

    typedef typename RFBUILDER::CenteredOrbitalType COT;
    typedef LocalizedBasisSet<COT> ThisBasisSetType;
    ThisBasisSetType* curBasis= new ThisBasisSetType(sourcePtcl,targetPtcl);

    //create the basis set
    //go thru the tree
    cur = cur->xmlChildrenNode;
    while(cur!=NULL) {
      string cname((const char*)(cur->name));
      if(cname == "atomicBasisSet") {
        const xmlChar* eptr=xmlGetProp(cur,(const xmlChar*)"elementType");
        if(eptr == NULL) {
          app_error() << "   Missing elementType attribute of atomicBasisSet.\n Abort at MOBasisBuilder::put " << endl;
          OHMMS::Controller->abort();
        }

        string elementType((const char*)eptr);
        map<string,BasisSetBuilder*>::iterator it = aoBuilders.find(elementType); 
        if(it == aoBuilders.end()) {
          AtomicBasisBuilder<RFBUILDER>* any = new AtomicBasisBuilder<RFBUILDER>(elementType);
          any->put(cur);
          COT* aoBasis= any->createAOSet(cur);

          if(aoBasis) { //add the new atomic basis to the basis set
            int activeCenter =sourcePtcl.getSpeciesSet().findSpecies(elementType);
            curBasis->add(activeCenter, aoBasis);
            aoBuilders[elementType]=any;

#if !defined(HAVE_MPI)
            string fname(elementType);
            fname.append(".j3.dat");
            ofstream fout(fname.c_str());
            int nr=aoBasis->Rnl.size();
            double r=0.0;
            while(r<20)
            {
              fout << r ;
              for(int i=0; i<nr; i++) fout << " " << aoBasis->Rnl[i]->evaluate(r,1.0/r);
              fout << endl;
              r += 0.013;
            }
#endif
          }
        }
      }
      cur = cur->next;
    }

    //resize the basis set
    curBasis->setBasisSetSize(-1);
    myBasisSet=curBasis;
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:55,代码来源:JastrowBasisBuilder.cpp


示例14: corr_tag

  /** create Input Analytic function
   *
   * \xmlonly
   * <jastrow name="Jne" 
   *   type="Two-Body|One-Body|Polarization|Three-Body-Geminal"
   *   function="pade|pade2|no-cusp" 
   *   transform="no|yes" spin="no|yes" 
   *   source="ionic system">
   *   <grid/>
   *   <correlation speciesA="sourceSpecies" speciesB="targetSpecies" type="pade|pade2|no-cusp">
   *      <parameter name=" ">value<parameter>
   *   </correlation>
   * </jastrow>
   * \endxmlonly
   */
  bool NJABBuilder::putInFunc(xmlNodePtr cur) {

    string corr_tag("correlation");
    string jastfunction("pade");
    int	ng=1;

    const xmlChar *ftype = xmlGetProp(cur, (const xmlChar *)"function");
    if(ftype != NULL) jastfunction = (const char*) ftype;
    const xmlChar* s=xmlGetProp(cur,(const xmlChar*)"source");
    if(s != NULL) {
      map<string,ParticleSet*>::iterator pa_it(ptclPool.find((const char*)s));
      if(pa_it == ptclPool.end()) return false;
      sourcePtcl = (*pa_it).second;
      ng=sourcePtcl->getSpeciesSet().getTotalNum();
    }

    int ia=0, ib=0, iab=0;
    cur = cur->children;
    while(cur != NULL) {
      string cname((const char*)(cur->name));
      if(cname == "grid") {
        gridPtr=cur; //save the pointer
      } else if(cname == dtable_tag) {
      	string source_name((const char*)(xmlGetProp(cur,(const xmlChar *)"source")));
        map<string,ParticleSet*>::iterator pa_it(ptclPool.find(source_name));
        if(pa_it == ptclPool.end()) return false;
	sourcePtcl=(*pa_it).second;
	ng = sourcePtcl->getSpeciesSet().getTotalNum();
	XMLReport("Number of sources " << ng)
        InFunc.resize(ng,0);
      } else if(cname ==corr_tag) {
        if(sourcePtcl==0) return false;
        string jfunctype(jastfunction);
	string spA((const char*)(xmlGetProp(cur,(const xmlChar *)"speciesA")));
        ftype = xmlGetProp(cur, (const xmlChar *)"type");
        if(ftype) {
          jfunctype=(const char*)ftype;
        }

        ia = sourcePtcl->getSpeciesSet().findSpecies(spA);
	if(!(InFunc[ia])) {
          InFuncType *j1=createInFunc(jfunctype);
	  InFunc[ia]= j1;
	  app_log() <<"   Added Jastrow Correlation ("<<jfunctype 
            << ") between " <<spA<<" and "<<targetPtcl.getName() << endl;
	}
	InFunc[ia]->put(cur);
        InFunc[ia]->addOptimizables(targetPsi.VarList);
      }
      cur = cur->next;
    } // while cur
    
    return true;
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:69,代码来源:NJABBuilder.cpp


示例15: while

  /** This should be moved to branch engine */
  bool EstimatorManager::put(MCWalkerConfiguration& W, QMCHamiltonian& H, xmlNodePtr cur) 
  {
    vector<string> extra;
    cur = cur->children;
    while(cur != NULL) 
    {
      string cname((const char*)(cur->name));
      if(cname == "estimator") 
      {
        xmlChar* att=xmlGetProp(cur,(const xmlChar*)"name");
        if(att) 
        {
          string aname((const char*)att);
          if(aname == "LocalEnergy") 
            add(new LocalEnergyEstimator(H),MainEstimatorName);
          else 
            extra.push_back(aname);
        }
      } 
      cur = cur->next;
    }

    if(Estimators.empty()) 
    {
      app_log() << "  Using a default LocalEnergyOnlyEstimator for the MainEstimator " << endl;
      add(new LocalEnergyOnlyEstimator(),MainEstimatorName);
    } 

    string SkName("sk");
    string GofRName("gofr");
    for(int i=0; i< extra.size(); i++)
    {
      if(extra[i] == SkName && W.Lattice.SuperCellEnum)
      {
        if(CompEstimators == 0) CompEstimators = new CompositeEstimatorSet;
        if(CompEstimators->missing(SkName))
        {
          app_log() << "  EstimatorManager::add " << SkName << endl;
          CompEstimators->add(new SkEstimator(W),SkName);
        }
      } else if(extra[i] == GofRName)
      {
        if(CompEstimators == 0) CompEstimators = new CompositeEstimatorSet;
        if(CompEstimators->missing(GofRName))
        {
          app_log() << "  EstimatorManager::add " << GofRName << endl;
          CompEstimators->add(new GofREstimator(W),GofRName);
        }
      }
    }
    //add extra
    return true;
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:54,代码来源:EstimatorManager.cpp


示例16: disloan

int
disloan(int n, struct lonstr *loan)
{
    time_t now;
    time_t accept;

    if (loan->l_status == LS_FREE)
	return 0;
    if (loan->l_ldur == 0)
	return 0;
    if (loan->l_loner != player->cnum && loan->l_lonee != player->cnum)
	return 0;
    (void)time(&now);
    pr("\nLoan #%d from %s to", n, cname(loan->l_loner));
    pr(" %s\n", cname(loan->l_lonee));
    if (loan->l_status == LS_PROPOSED) {
	pr("(proposed) principal=$%d interest rate=%d%%",
	   loan->l_amtdue, loan->l_irate);
	pr(" duration(days)=%d\n", loan->l_ldur);
	if (loan->l_duedate < now) {
	    loan->l_status = LS_FREE;
	    putloan(n, loan);
	    pr("This offer has expired\n");
	    return 0;
	}
	accept = loan->l_lastpay + loan->l_ldur * SECS_PER_DAY;
	pr("Loan must be accepted by %s", ctime(&accept));
	return 1;
    }

    pr("Amount paid to date $%d\n", loan->l_amtpaid);
    pr("Amount due (if paid now) $%.2f", loan_owed(loan, now));
    if (now <= loan->l_duedate) {
	pr(" (if paid on due date) $%.2f\n",
	   loan_owed(loan, loan->l_duedate));
	pr("Due date is %s", ctime(&loan->l_duedate));
    } else
	pr(" ** In Arrears **\n");
    return 1;
}
开发者ID:gefla,项目名称:empserver,代码行数:40,代码来源:disloan.c


示例17: extendYear

RunnerDBEntry *RunnerDB::getRunnerByName(const string &name, int clubId,
                                         int expectedBirthYear) const
{
  if (expectedBirthYear>0 && expectedBirthYear<100)
    expectedBirthYear = extendYear(expectedBirthYear);

  setupNameHash();
  vector<int> ix;
  string cname(canonizeName(name.c_str()));
  multimap<string, int>::const_iterator it = nhash.find(cname);

  while (it != nhash.end() && cname == it->first) {
    ix.push_back(it->second);
    ++it;
  }

  if (ix.empty())
    return 0;

  if (clubId == 0) {
    if (ix.size() == 1)
      return (RunnerDBEntry *)&rdb[ix[0]];
    else
      return 0; // Not uniquely defined.
  }

  // Filter on club
  vector<int> ix2;
  for (size_t k = 0;k<ix.size(); k++)
    if (rdb[ix[k]].clubNo == clubId || rdb[ix[k]].clubNo==0)
      ix2.push_back(ix[k]);

  if (ix2.empty())
    return 0;
  else if (ix2.size() == 1)
    return (RunnerDBEntry *)&rdb[ix2[0]];
  else if (expectedBirthYear > 0) {
    int bestMatch = 0;
    int bestYear = 0;
    for (size_t k = 0;k<ix2.size(); k++) {
      const RunnerDBEntry &re = rdb[ix2[k]];
      if (abs(re.birthYear-expectedBirthYear) < abs(bestYear-expectedBirthYear)) {
        bestMatch = ix2[k];
        bestYear = re.birthYear;
      }
    }
    if (bestYear>0)
      return (RunnerDBEntry *)&rdb[bestMatch];
  }

  return 0;
}
开发者ID:ledusledus,项目名称:meos,代码行数:52,代码来源:RunnerDB.cpp


示例18: makeCanvas

//--- Make Canvas ---
TCanvas * makeCanvas(const char* name, const char* title, bool log=false, const char* opt="", const int dx = 1000, const int dy = 700)
{
   //printf("Canvas opt: %s\n", opt);
   TCanvas * c;
   TString cname(Form("c%s",name));

   if (!TString(opt).Contains("same")) {
      c = new TCanvas(cname.Data(),title,dx,dy);
//      printf("Canvas: %d\n",c);
      if (log) c->SetLogy();
   }
//   printf("Canvas %s: %d\n",cname.Data(), c);
   return c;
}
开发者ID:CmsHI,项目名称:CVS_SavedFMa,代码行数:15,代码来源:savedfrankTools.C


示例19: cvalue

void ApacheReply::commitHeader( const Falcon::String& name, const Falcon::String& value )
{
   Falcon::AutoCString cvalue( value );

   if ( name.compareIgnoreCase( "Content-Type" ) == 0 )
   {
      m_request->content_type = apr_pstrdup ( m_request->pool, cvalue.c_str() );
   }
   else
   {
      Falcon::AutoCString cname( name );
      apr_table_add( m_request->headers_out, cname.c_str(), cvalue.c_str() );
   }
}
开发者ID:Klaim,项目名称:falcon,代码行数:14,代码来源:apache_reply.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cngetc函数代码示例发布时间:2022-05-30
下一篇:
C++ cn_netlink_send函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap