本文整理汇总了C++中MethodTable::store方法的典型用法代码示例。如果您正苦于以下问题:C++ MethodTable::store方法的具体用法?C++ MethodTable::store怎么用?C++ MethodTable::store使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MethodTable
的用法示例。
在下文中一共展示了MethodTable::store方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: duplicate
MethodTable* MethodTable::duplicate(STATE) {
size_t size, i;
MethodTable* dup = 0;
utilities::thread::SpinLock::LockGuard lg(lock_);
size = bins_->to_native();
dup = MethodTable::create(state, size);
// Allow for subclassing.
dup->klass(state, class_object(state));
size_t num = bins_->to_native();
MethodTableBucket* entry = 0;
for(i = 0; i < num; i++) {
entry = try_as<MethodTableBucket>(values_->at(state, i));
while(entry) {
dup->store(state, entry->name(), entry->method(), entry->visibility());
entry = try_as<MethodTableBucket>(entry->next());
}
}
return dup;
}
示例2: hookup_prim
static void hookup_prim(STATE, Symbol* meth, Symbol* prim) {
MethodTable* tbl = G(rubinius)->metaclass(state)->method_table();
Executable* oc = Executable::allocate(state, Qnil);
oc->primitive(state, prim);
assert(oc->resolve_primitive(state));
tbl->store(state, meth, oc, G(sym_public));
}
示例3: attach_primitive
void System::attach_primitive(STATE, Module* mod, bool meta, Symbol* name, Symbol* prim) {
MethodTable* tbl;
if(meta) {
tbl = mod->singleton_class(state)->method_table();
} else {
tbl = mod->method_table();
}
Executable* oc = Executable::allocate(state, Qnil);
oc->primitive(state, prim);
oc->resolve_primitive(state);
tbl->store(state, name, oc, G(sym_public));
}
示例4: duplicate
MethodTable* MethodTable::duplicate(STATE) {
size_t size, i;
MethodTable *dup;
size = bins_->to_native();
dup = MethodTable::create(state, size);
// Allow for subclassing.
dup->klass(state, class_object(state));
size_t num = entries_->to_native();
Array* entries = all_entries(state);
for(i = 0; i < num; i++) {
MethodTableBucket* entry = as<MethodTableBucket>(entries->get(state, i));
dup->store(state, entry->name(), entry->method(), entry->visibility());
}
return dup;
}