本文整理汇总了C++中Executable类的典型用法代码示例。如果您正苦于以下问题:C++ Executable类的具体用法?C++ Executable怎么用?C++ Executable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Executable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Executable
bool Directory::cp(const File& file) {
// exe ise direk deep-independet copy al
const Executable *temp = dynamic_cast<const Executable *> (&file);
if (temp != NULL) {
Executable *nExe = new Executable(*temp);
nExe->setTime("18/12/15"); // zamanlar temsilidir
nExe->updatePath(this->path() + "/" + nExe->getName()); //path guncelle
m_inFiles.insert(nExe); // containere sirali olarak ekle
}
// klasor ise copy constuctor ile o klasorun deep copy sini al
const Directory *temp1 = dynamic_cast<const Directory *> (&file);
if (temp1 != NULL) {
Directory *nDir = new Directory(*temp1);
nDir->setTime("19/12/15"); // zamanlar temsilidir
nDir->updatePath(this->path() + "/" + nDir->getName()); // path upd.
m_inFiles.insert(nDir);
}
// text dosyasi ise direk copy al
const TextFile *temp2 = dynamic_cast<const TextFile *> (&file);
if (temp2 != NULL) {
TextFile *nText = new TextFile(*temp2);
nText->setTime("21/12/15"); // zamanlar temsilidir
nText->updatePath(this->path() + "/" + nText->getName());
m_inFiles.insert(nText);
}
// dangling pointers
temp = NULL;
temp1 = NULL;
temp2 = NULL;
return true;
}
示例2: lookup
Object* CallSite::empty_cache(STATE, CallSite* call_site, CallFrame* call_frame,
Arguments& args)
{
Object* const recv = args.recv();
Class* const recv_class = recv->direct_class(state);
LookupData lookup(call_frame->self(), recv->lookup_begin(state), G(sym_public));
Dispatch dis(call_site->name());
if(!dis.resolve(state, call_site->name(), lookup)) {
if(!lookup_method_missing(state, call_frame, args,
dis, call_frame->self(), recv->lookup_begin(state))) {
return NULL;
}
}
state->vm()->metrics().machine.methods_invoked++;
call_site->update(state, recv_class, dis);
Executable* meth = dis.method;
Module* mod = dis.module;
if(meth->custom_call_site_p()) {
CallSiteInformation info(call_site->executable(), call_site->ip());
state->set_call_site_information(&info);
Object* res = meth->execute(state, call_frame, meth, mod, args);
state->set_call_site_information(NULL);
return res;
} else {
return meth->execute(state, call_frame, meth, mod, args);
}
}
示例3: WAIT_SEMAPHOR
void SafeManager::onExecutableStdout(void* which, const char* msg)
{
WAIT_SEMAPHOR();
Executable* exe = static_cast<Executable*>(which);
if(eventReceiver)
eventReceiver->onModStdout(exe->getID(), msg);
POST_SEMAPHOR();
}
示例4: 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));
}
示例5: G
Executable* Executable::allocate(STATE, Object* self) {
Executable* executable =
state->memory()->new_object<Executable>(state, G(executable));
Executable::initialize(state, executable, Executable::default_executor);
if(Class* cls = try_as<Class>(self)) {
executable->klass(state, cls);
}
return executable;
}
示例6: closeEvent
void AnimationTestDlg::closeEvent(QCloseEvent* pEvent)
{
if (mpPlugIn != NULL)
{
Executable* pExecutable = dynamic_cast<Executable*>(mpPlugIn);
if (pExecutable != NULL)
{
pExecutable->abort();
}
}
QDialog::closeEvent(pEvent);
}
示例7: allocate
Executable* Executable::allocate(STATE, Object* self) {
Executable* executable = state->new_object<Executable>(G(executable));
executable->primitive(state, (Symbol*)Qnil);
executable->serial(state, Fixnum::from(0));
executable->set_executor(Executable::default_executor);
if(kind_of<Class>(self)) {
state->om->set_class(executable, self);
}
return executable;
}
示例8: abort
bool AutoImporter::abort()
{
Executable* pExecutable = dynamic_cast<Executable*>(mpPlugIn);
if (pExecutable != NULL)
{
if (pExecutable->hasAbort() == true)
{
return pExecutable->abort();
}
}
return false;
}
示例9: lookup
Object* CallSite::empty_cache_super(STATE, CallSite* call_site, CallFrame* call_frame,
Arguments& args)
{
Symbol* original_name = call_frame->original_name();
if(call_site->name_ != original_name) {
call_site->name_ = original_name;
args.set_name(call_site->name_);
}
Object* const recv = args.recv();
Class* const recv_class = recv->lookup_begin(state);
Module* const start = call_frame->module()->superclass();
LookupData lookup(call_frame->self(), start, G(sym_private));
Dispatch dis(call_site->name());
if(start->nil_p() || !dis.resolve(state, call_site->name(), lookup)) {
LookupData missing_lookup(call_frame->self(), recv_class, G(sym_private));
Dispatch missing_dis(G(sym_method_missing));
missing_dis.resolve(state, G(sym_method_missing), missing_lookup);
if(missing_dis.method_missing != eNone) {
Exception::internal_error(state, call_frame, "no method_missing");
return 0;
}
args.unshift(state, call_site->name());
dis.method = missing_dis.method;
dis.module = missing_dis.module;
dis.method_missing = eSuper;
state->vm()->set_method_missing_reason(dis.method_missing);
}
call_site->update(state, recv_class, dis);
Executable* meth = dis.method;
Module* mod = dis.module;
if(meth->custom_call_site_p()) {
CallSiteInformation info(call_site->executable(), call_site->ip());
state->set_call_site_information(&info);
Object* res = meth->execute(state, call_frame, meth, mod, args);
state->set_call_site_information(NULL);
return res;
} else {
return meth->execute(state, call_frame, meth, mod, args);
}
}
示例10: if
Object* InlineCache::empty_cache(STATE, InlineCache* cache, CallFrame* call_frame,
Arguments& args)
{
args.set_name(cache->name);
Object* const recv = args.recv();
Class* const recv_class = recv->lookup_begin(state);
MethodCacheEntry* mce = 0;
MethodMissingReason reason =
cache->fill_public(state, call_frame->self(), cache->name,
recv_class, mce);
if(reason != eNone) {
state->vm()->set_method_missing_reason(reason);
if(!cache->fill_method_missing(state, recv_class, mce)) {
Exception::internal_error(state, call_frame, "no method_missing");
return 0;
}
args.unshift(state, cache->name);
cache->execute_backend_ = check_cache_mm;
} else {
if(recv->fixnum_p()) {
cache->execute_backend_ = check_cache_fixnum;
} else if(recv->symbol_p()) {
cache->execute_backend_ = check_cache_symbol;
} else if(recv->reference_p()) {
cache->execute_backend_ = check_cache_reference;
} else {
cache->execute_backend_ = check_cache;
}
}
// Make sure we sync here, so the MethodCacheEntry mce is
// guaranteed completely initialized. Otherwise another thread
// might see an incompletely initialized MethodCacheEntry.
atomic::memory_barrier();
cache->cache_ = mce;
cache->update_seen_classes(mce);
call_frame->cm->write_barrier(state, mce);
Executable* meth = mce->method();
Module* mod = mce->stored_module();
return meth->execute(state, call_frame, meth, mod, args);
}
示例11: 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));
}
示例12: allocate
Executable* Executable::allocate(STATE, Object* self) {
Executable* executable = state->new_object<Executable>(G(executable));
executable->primitive(state, nil<Symbol>());
executable->serial(state, Fixnum::from(0));
executable->inliners_ = 0;
executable->prim_index_ = -1;
executable->set_executor(Executable::default_executor);
if(Class* cls = try_as<Class>(self)) {
executable->klass(state, cls);
}
return executable;
}
示例13: empty_cache_super
Object* InlineCache::empty_cache_super(STATE, InlineCache* cache, CallFrame* call_frame,
Arguments& args)
{
Symbol* original_name = call_frame->original_name();
if(cache->name != original_name) {
cache->name = original_name;
}
args.set_name(cache->name);
Object* const recv = args.recv();
Class* const recv_class = recv->lookup_begin(state);
MethodCacheEntry* mce = 0;
Module* const start = call_frame->module()->superclass();
if(start->nil_p() || !cache->fill_private(state, cache->name, start, recv_class, mce)) {
state->vm()->set_method_missing_reason(eSuper);
// Don't use start when looking up method_missing!
// Always completely redispatch for method_missing.
// github#157
if(!cache->fill_method_missing(state, recv_class, mce)) {
Exception::internal_error(state, call_frame, "no method_missing");
return 0;
}
args.unshift(state, cache->name);
cache->execute_backend_ = check_cache_super_mm;
} else {
cache->execute_backend_ = check_cache_super;
}
// Make sure we sync here, so the MethodCacheEntry mce is
// guaranteed completely initialized. Otherwise another thread
// might see an incompletely initialized MethodCacheEntry.
atomic::memory_barrier();
cache->cache_ = mce;
cache->update_seen_classes(mce);
call_frame->cm->write_barrier(state, mce);
Executable* meth = mce->method();
Module* mod = mce->stored_module();
return meth->execute(state, call_frame, meth, mod, args);
}
示例14: strncmp
bool CallingConvention_x86_64_systemv::matches(TargetInfo &target, Executable &executable) const
{
const char arch[] = "x86";
const char exe[] = "ELF 64";
return strncmp(target.targetName().c_str(), arch, sizeof arch - 1) == 0
&& strncmp(executable.getExecutableType().c_str(), exe, sizeof exe - 1) == 0;
}
示例15: check_cache
Object* InlineCache::check_cache(STATE, InlineCache* cache, CallFrame* call_frame,
Arguments& args)
{
MethodCacheEntry* mce = cache->cache_;
args.set_name(cache->name);
if(likely(mce && mce->receiver_class() == args.recv()->lookup_begin(state))) {
Executable* meth = mce->method();
Module* mod = mce->stored_module();
return meth->execute(state, call_frame, meth, mod, args);
}
return cache->initialize(state, call_frame, args);
}