Example #1
0
void LLSideTrayListener::getPanels(const LLSD& event) const
{
    LLSD reply;

    LLSideTray* tray = mGetter();
    // Iterate through the attached tabs.
    LLSD::Integer ord(0);
    for (LLSideTray::child_vector_t::const_iterator
             ati(tray->mTabs.begin()), atend(tray->mTabs.end());
         ati != atend; ++ati)
    {
        // We don't have access to LLSideTrayTab: the class definition is
        // hidden in llsidetray.cpp. But as LLSideTrayTab isa LLPanel, use the
        // LLPanel API. Unfortunately, without the LLSideTrayTab definition,
        // the compiler doesn't even know this LLSideTrayTab* is an LLPanel*.
        // Persuade it.
        LLPanel* tab(tab_cast<LLPanel*>(*ati));
        reply[tab->getName()] = getTabInfo(tab).with("attached", true).with("ord", ord);
    }

    // Now iterate over the detached tabs. These can also be opened via
    // SideTray.ShowPanel.
    ord = 0;
    for (LLSideTray::child_vector_t::const_iterator
             dti(tray->mDetachedTabs.begin()), dtend(tray->mDetachedTabs.end());
         dti != dtend; ++dti)
    {
        LLPanel* tab(tab_cast<LLPanel*>(*dti));
        reply[tab->getName()] = getTabInfo(tab).with("attached", false).with("ord", ord);
    }

    sendReply(reply, event);
}
Example #2
0
bool BFCC::generate_ir(std::string instr) {
	// The compiling process can't continue if there is an error
	if (errhdlr.has_error()) {
		return false;
	}

	auto nodelist = lexer->gen_nodes(instr);
	BFCC_AST_to_IR ati(params, errhdlr);
	ilist = ati.generate(nodelist);

	return errhdlr.has_error();
}
Example #3
0
double petabricks::PetabricksRuntime::raceConfigs(int n, const std::vector<std::string>* files, int /*retries*/) {
  TestResult aresult;
  TestResult bresult;
  SubprocessTestIsolation ati(GRAPH_MAX_SEC);
  SubprocessTestIsolation bti(GRAPH_MAX_SEC);
  TunableManager& tm = TunableManager::instance();

  int ta = (int)( worker_threads * RACE_SPLIT_RATIO );
  int tb = worker_threads - ta;
  JTRACE("race split")(ta)(tb);
  try {
    loadTestInput(n, files);
    if(CONFIG_FILENAME_ALT != "None") {
      if(ati.beginTest(worker_threads/2)) {
        tm.load(CONFIG_FILENAME);
        _main->reallocate(std::max(IOGEN_N, n));
        computeWrapperSubproc(ati, -1, aresult, NULL);
        ati.endTest(aresult);
      } else if(bti.beginTest(worker_threads/2)) {
        tm.load(CONFIG_FILENAME_ALT);
        _main->reallocate(std::max(IOGEN_N, n));
        computeWrapperSubproc(bti, -1, bresult, NULL);
        bti.endTest(bresult);
      }else{
        SubprocessTestIsolation::recvFirstResult(ati, aresult, bti, bresult);
      }
    } else {
      if(ati.beginTest(worker_threads)) {
        tm.load(CONFIG_FILENAME);
        _main->reallocate(std::max(IOGEN_N, n));
        computeWrapperSubproc(ati, -1, aresult, NULL);
        ati.endTest(aresult);
      }else{
        ati.recvResult(aresult);
      }
    }
  } catch(...) {
    UNIMPLEMENTED();
  }
  std::cout.precision(15);
  std::cout << "<raceresult>" << std::endl;
  aresult.writexml(std::cout, "0");
  std::cout << std::endl;
  bresult.writexml(std::cout, "1");
  std::cout << std::endl;
  std::cout << "</raceresult>" << std::endl;
  return std::min(aresult.time, bresult.time);
}