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


C++ Signature函数代码示例

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


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

示例1: Signature

 Signature SignalSubscriber::signature() const
 {
   if (handler)
   {
     if (handler.functionType() == dynamicFunctionTypeInterface())
       return Signature(); // no arity checking is possible
     else
       return handler.parametersSignature();
   }
   else if (target)
   {
     AnyObject locked = target->lock();
     if (!locked)
       return Signature();
     const MetaMethod* ms = locked.metaObject().method(method);
     if (!ms)
     {
       qiLogWarning() << "Method " << method <<" not found.";
       return Signature();
     }
     else
       return ms->parametersSignature();
   }
   else
     return Signature();
 }
开发者ID:cgestes,项目名称:libqi,代码行数:26,代码来源:signal.cpp

示例2: getSigner

Signature PrivateKey::sign( Hasher hasher, const void* data, Size size, Monitor& monitor )
{
	if (!monitor) return Signature();
	Signer signer = getSigner(monitor); if (!monitor) return Signature();
	signer.setHasher(hasher,monitor);
	return signer.sign(*this,data,size,monitor);
}
开发者ID:relonger,项目名称:ECryptoLib,代码行数:7,代码来源:PrivateKey.cpp

示例3: LDUMP

bool cCamCryptNagra::MakeSessionKey(unsigned char *out, const unsigned char *camdata)
{
  if(!hasMod) return false;
  if(LOG(L_SC_PROC)) {
    unsigned char bb[64];
    camMod.Put(bb,sizeof(bb));
    LDUMP(L_SC_PROC,bb,sizeof(bb),"Sessionkey negotiation CAMMOD:");
    }
  //decrypt $2A data here and prepare $2B reply
  if(rsa.RSA(out,camdata,64,camExp,camMod)!=64) return false;
  LDUMP(L_SC_PROC,out,64,"CMD 2A/26 after RSA:");

  unsigned char key[16], sess[16];
  InitKey(key,signature,cardid);
  LDUMP(L_SC_PROC,key,16,"first IDEA key: ");
  Signature(sess,key,out,32);
  memcpy(key,sess,8);
  memcpy(key+8,sess,8);
  LDUMP(L_SC_PROC,key,16,"second IDEA key:");
  Signature(sess+8,key,out,32);
  LDUMP(L_SC_PROC,sess,16,"SESSION KEY:    ");
  idea.SetDecKey(sess,&sessKey);

  if(rsa.RSA(out,out,64,camExp,camMod)!=64) return false;
  LDUMP(L_SC_PROC,out,64,"CMD 2B/27 data:");
  return true;
}
开发者ID:3PO,项目名称:vdr-plugin-sc,代码行数:27,代码来源:sc-nagra.c

示例4: isIntegerOrDouble

  static bool isIntegerOrDouble(AnyReference value)
  {

    Signature signature(value.signature());
    return signature.isConvertibleTo(Signature("i")) != 0.0 ||
           signature.isConvertibleTo(Signature("d")) != 0.0;
  }
开发者ID:cgestes,项目名称:libqicore,代码行数:7,代码来源:parametermodel.cpp

示例5: AmControlChangePrefView

BView* AmStdViewFactory::NewPrefView(	BRect f, BMessage* prefs,
										const BString& key)
{
	if (key == CONTROL_CHANGE)
		return new AmControlChangePrefView(f, prefs, Signature(), key);

	AmStdFactoryPrefView*	v = new AmStdFactoryPrefView(f, prefs, Signature(), key);
	if (v) v->AddViews();
	return v;
}
开发者ID:HaikuArchives,项目名称:Sequitur,代码行数:10,代码来源:AmStdViewFactory.cpp

示例6: memcmp

BOOL CNodeList::CheckNode(CNode* pNode)
{
	BOOL flag = FALSE;

	// controlla i puntatori e confronta la signature
	if(pNode)
		if(*pNode->signature)
			flag = memcmp(pNode->signature,Signature(),strlen(Signature()))==0;

	return(flag);
}
开发者ID:code4bones,项目名称:crawlpaper,代码行数:11,代码来源:CNodeList.cpp

示例7: ss

Signature TextureProxy::MakeSignature(const Proxy<res::Image> &image, vid::opengl::TextureFormat format, vid::opengl::TextureFlags flags, const math::Vector<2, bool> &clamp)
{
    std::ostringstream ss(image.GetSignature());
    switch (format)
    {
    case vid::opengl::defaultTextureFormat:
        break;
    case vid::opengl::alphaTextureFormat:
        ss << ":alpha";
        break;
    case vid::opengl::luminanceTextureFormat:
        ss << ":luminance";
        break;
    default:
        assert(!"invalid texture format");
    }
    if (flags & vid::opengl::filterTextureFlag) ss << ":filter";
    if (flags & vid::opengl::mipmapTextureFlag) ss << ":mipmap";
    if (Any(clamp))
    {
        ss << ":clamp";
        if      (!clamp.x) ss << ".y";
        else if (!clamp.y) ss << ".x";
    }
    return Signature("OpenGL texture", ss.str());
}
开发者ID:davidosborn,项目名称:page,代码行数:26,代码来源:TextureProxy.cpp

示例8: CopyIfParticles

int SignatureLeptonTagger::Train(Event const& event, boca::PreCuts const&, Tag tag)
{
    INFO0;
   std::vector<Lepton> leptons = event.Leptons().leptons();
    if (leptons.size() < 2) return 0;
   std::vector<Particle> particles = event.Partons().GenParticles();
   std::vector<Particle> lepton_particle = CopyIfParticles(particles, {Id::electron, Id::muon});
//     ERROR(lepton_particle);
    lepton_particle = CopyIfGrandMother(lepton_particle, Id::top);
//     ERROR(lepton_particle);
    std::vector<Lepton> final_leptons = CopyIfClose(leptons, lepton_particle);
//     ERROR(final_leptons);
    std::vector<Doublet> doublets = higgs_reader_.Multiplets(event);
    std::vector<Particle> higgses = CopyIfParticles(particles, {Id::higgs, Id::CP_violating_higgs});
    std::vector<Doublet> final_doublets = BestMatches(doublets, higgses, tag);

    std::vector<MultipletSignature<Quartet211>> quartets = Triples(final_leptons, final_doublets, [&](Singlet const& singlet_1, Singlet const& singlet_2, Doublet const& doublet) {
        MultipletSignature<Quartet211> quartet = Signature(doublet, singlet_1, singlet_2);
        quartet.SetTag(tag);
        return quartet;
    });
    DEBUG(quartets.size());
    if (tag == Tag::signal) quartets = ReduceResult(quartets, 1);
    DEBUG(quartets.size());
    return  SaveEntries(quartets);
}
开发者ID:Teddym0913,项目名称:BoCA,代码行数:26,代码来源:SignatureLeptonTagger.cpp

示例9: Monitor

Signature SignerReal::sign( PrivateKey privkey, Digest hash, Monitor& monitor )
{
	if (!check_interface(monitor)) return Signature();

	Parameters params = privkey.getAlgParams(acSign, Monitor());
	if (params) setAlgParams(params,monitor);

	Padder curpad = padder;
	if (privkey.getPadder(Monitor()))
	{
		curpad = privkey.getPadder(monitor);
	} else {
		//TODO: find default padder
	}

	Error error;
	if (random)
	{
		IRef<eprovider::ProviderInterface> randomer = creator.getCreatureCurrentInterface(random);
		if (randomer) iface->setRandom(session, randomer.cast<eprovider::RandomGenerator>().get(), error);
	}

	eprovider::TheKey thekey = creator.getCreatureCurrentTheKey(privkey);

	Size hashsize = iface->getMaxHashSize(thekey, error);
	if (curpad.ok() && hashsize.bits()) hash = curpad.pad(hash, hashsize, monitor); if (!monitor) return Signature();
	Data hashblock = hash.asData();

	eprovider::Block binsign;
	RECOVER_CALL( (binsign = iface->signHash(session, hashblock.get(), hashblock.size(), thekey, error)) );

	Snapshot snapshot = creator.createSnapshot(binsign.get(), binsign.size(), binsign.encid(), iface->getKeyId(kcSignature));
	return snapshot.reviveSignature(monitor);
}
开发者ID:relonger,项目名称:ECryptoLib,代码行数:34,代码来源:SignerReal.cpp

示例10: entry_point

    static int entry_point(lua_State* L)
    {
        function_object_impl const* impl =
            *static_cast<function_object_impl const**>(
                lua_touserdata(L, lua_upvalueindex(1)));

        int results = 0;
        bool error = false;

# ifndef LUABIND_NO_EXCEPTIONS
        try
#endif
            // Scope neeeded to destroy invoke_context before calling lua_error()
        {
            invoke_context ctx;
            results = invoke(
                          L, *impl, ctx, impl->f, Signature(), impl->policies);
            if (!ctx)
            {
                ctx.format_error(L, impl);
                error = true;
            }
        }
#ifndef LUABIND_NO_EXCEPTIONS
        catch (...)
        {
            error = true;
            handle_exception_aux(L);
        }
#endif

        if (error)
            lua_error(L);
        return results;
    }
开发者ID:ValyriaTear,项目名称:luabind,代码行数:35,代码来源:make_function.hpp

示例11: qiLogDebug

  bool ParameterModel::addChoice(ChoiceModelPtr choice)
  {
    qiLogDebug() << "addChoice function" << std::endl;
    Signature signature(_p->_metaProperty.signature());

    //if false choice and parameter are the same type
    if(Signature(choice->value().signature()).isConvertibleTo(signature) < 1.0f )
    {
      qiLogWarning() << "choice.type (i.e "
                     << choice->value().signature().toString()
                     << ") != parameter.type (i.e "
                     << _p->_defaultValue.signature().toString()
                     <<")"
                     << std::endl;
      return false;
    }

    //If choice.value is not in [parameter.min, paramater.max] then the choice
    //is incorrect
    if(!_p->inInterval(choice->value(),
                       _p->_min,
                       _p->_max)
       )
    {
      qiLogInfo()    << "Choice : is not in interval"
                     << std::endl;
      return false;
    }

    _p->_choices.push_front(choice);
    return true;
  }
开发者ID:cgestes,项目名称:libqicore,代码行数:32,代码来源:parametermodel.cpp

示例12: CopyIfParticle

int SignatureT::Train(boca::Event const& event, boca::PreCuts const&, Tag tag)
{
    INFO0;
    auto particles = event.GenParticles();
    auto triplets = top_reader_.Multiplets(event);
    auto tops = CopyIfParticle(particles, Id::top);

    auto final_triplets = triplets;
//     auto final_triplets = BestMatches(triplets, tops, tag);
    DEBUG(triplets.size(), tops.size(), final_triplets.size());

    auto doublets = higgs_reader_.Multiplets(event);
    auto higgses = CopyIfParticles(particles, {Id::higgs, Id::CP_violating_higgs});
    auto final_doublets = doublets;
//     auto final_doublets = BestMatches(doublets, higgses, tag);
    DEBUG(doublets.size(), higgses.size(), final_doublets.size());

    auto octets = Triples(final_triplets, final_doublets, [&](Triplet const & triplet_1, Triplet const & triplet_2, Doublet const & doublet) {
        auto octet = Signature(triplet_1, triplet_2, doublet);
        octet.SetTag(tag);
        return octet;
    });
    DEBUG(octets.size());
    return SaveEntries(octets, 1);
}
开发者ID:BoostedColliderAnalysis,项目名称:BoCA,代码行数:25,代码来源:SignatureT.cpp

示例13: 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

示例14: Signature

//---------------------------------------------------------------------------
void File_Png::Data_Parse()
{
    if (!Signature_Parsed)
    {
        Signature();
        return;
    }

    Element_Size-=4; //For CRC

    #define CASE_INFO(_NAME, _DETAIL) \
        case Elements::_NAME : Element_Info1(_DETAIL); _NAME(); break;

    //Parsing
    switch (Element_Code)
    {
        CASE_INFO(IDAT,                                         "Image data");
        CASE_INFO(IEND,                                         "Image trailer");
        CASE_INFO(IHDR,                                         "Image header");
        CASE_INFO(PLTE,                                         "Palette table");
        default : Skip_XX(Element_Size,                         "Unknown");
    }

    Element_Size+=4; //For CRC
    Skip_B4(                                                    "CRC");
}
开发者ID:Chlara,项目名称:MediaConch,代码行数:27,代码来源:File_Png.cpp

示例15: invoke

 int invoke(
     lua_State* L, function_object const& self, invoke_context& ctx
   , tagged_function<Signature, F> const& tagged
   , Signature, Policies const& policies)
 {
     return invoke(L, self, ctx, tagged.f, Signature(), policies);
 }
开发者ID:Chiur,项目名称:luabind,代码行数:7,代码来源:tag_function.hpp


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