本文整理汇总了C++中DataObjectRef::getSignatureStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ DataObjectRef::getSignatureStatus方法的具体用法?C++ DataObjectRef::getSignatureStatus怎么用?C++ DataObjectRef::getSignatureStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObjectRef
的用法示例。
在下文中一共展示了DataObjectRef::getSignatureStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onVerifiedDataObject
/*
public event handler on verified DataObject
means that the DataObject is verified by the SecurityManager
*/
void DataManager::onVerifiedDataObject(Event *e)
{
if (!e || !e->hasData())
return;
DataObjectRef dObj = e->getDataObject();
if (!dObj) {
HAGGLE_DBG("Verified data object event without data object!\n");
return;
}
if (dataObjectsReceived.size() >= MAX_DATAOBJECTS_LISTED) {
dataObjectsReceived.pop_front();
}
dataObjectsReceived.push_back(dObj->getIdStr());
HAGGLE_DBG("%s Received data object [%s]\n", getName(), dObj->getIdStr());
#ifdef DEBUG
// dObj->print(NULL); // MOS - NULL means print to debug trace
#endif
if (dObj->getSignatureStatus() == DataObject::SIGNATURE_INVALID) {
// This data object had a bad signature, we should remove
// it from the bloomfilter
HAGGLE_DBG("Data object [%s] had bad signature, removing from bloomfilter\n", dObj->getIdStr());
localBF->remove(dObj);
kernel->getThisNode()->setBloomfilter(*localBF, setCreateTimeOnBloomfilterUpdate);
return;
}
if (dObj->getDataState() == DataObject::DATA_STATE_VERIFIED_BAD) {
HAGGLE_ERR("Data in data object flagged as bad! -- discarding\n");
if (localBF->has(dObj)) {
// Remove the data object from the bloomfilter since it was bad.
localBF->remove(dObj);
kernel->getThisNode()->setBloomfilter(*localBF, setCreateTimeOnBloomfilterUpdate);
}
return;
} else if (dObj->getDataState() == DataObject::DATA_STATE_NOT_VERIFIED && helper) {
// Call our helper to verify the data in the data object.
if (dObj->dataIsVerifiable()) {
helper->addTask(new DataTask(DATA_TASK_VERIFY_DATA, dObj));
return;
}
}
handleVerifiedDataObject(dObj);
}