本文整理汇总了C++中HashTable::entry方法的典型用法代码示例。如果您正苦于以下问题:C++ HashTable::entry方法的具体用法?C++ HashTable::entry怎么用?C++ HashTable::entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HashTable
的用法示例。
在下文中一共展示了HashTable::entry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOwnPropertyDescriptor
bool JSTestEventTarget::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
const HashEntry* entry = JSTestEventTargetTable.entry(exec, propertyName);
if (entry) {
PropertySlot slot;
slot.setCustom(thisObject, entry->propertyGetter());
descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
return true;
}
unsigned index = propertyName.asIndex();
if (index != PropertyName::NotAnIndex && index < static_cast<TestEventTarget*>(thisObject->impl())->length()) {
PropertySlot slot;
slot.setCustomIndex(thisObject, index, indexGetter);
descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
return true;
}
if (canGetItemsForName(exec, static_cast<TestEventTarget*>(thisObject->impl()), propertyName)) {
PropertySlot slot;
slot.setCustom(thisObject, nameGetter);
descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
return true;
}
return getStaticValueDescriptor<JSTestEventTarget, Base>(exec, &JSTestEventTargetTable, thisObject, propertyName, descriptor);
}
示例2: getOwnPropertySlot
bool JSTestEventTarget::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
const HashEntry* entry = JSTestEventTargetTable.entry(exec, propertyName);
if (entry) {
slot.setCustom(thisObject, entry->propertyGetter());
return true;
}
unsigned index = propertyName.asIndex();
if (index != PropertyName::NotAnIndex && index < static_cast<TestEventTarget*>(thisObject->impl())->length()) {
slot.setCustomIndex(thisObject, index, indexGetter);
return true;
}
if (canGetItemsForName(exec, static_cast<TestEventTarget*>(thisObject->impl()), propertyName)) {
slot.setCustom(thisObject, thisObject->nameGetter);
return true;
}
return getStaticValueSlot<JSTestEventTarget, Base>(exec, &JSTestEventTargetTable, thisObject, propertyName, slot);
}