本文整理汇总了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();
}
示例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);
}
示例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;
}
示例4: isIntegerOrDouble
static bool isIntegerOrDouble(AnyReference value)
{
Signature signature(value.signature());
return signature.isConvertibleTo(Signature("i")) != 0.0 ||
signature.isConvertibleTo(Signature("d")) != 0.0;
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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");
}
示例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);
}