Example #1
0
bool NBTTagIntArray::equals(std::shared_ptr<NBTTag> tag) {
    return tag != nullptr && tag->isIntArray() && tag->getName() == name && tag->asIntArray()->value == value;
}
Example #2
0
bool NBTTagDouble::equals(std::shared_ptr<NBTTag> tag) {
    return tag != nullptr && tag->isDouble() && tag->getName() == name && tag->asDouble()->value == value;
}
Example #3
0
void
OneInterestRequester::OnData(std::shared_ptr<const ndn::Data> data)
{
  App::OnData(data);
  NS_LOG_DEBUG("<< D: " << data->getName());
}
Example #4
0
void executor::RunBaseline(std::shared_ptr<Benchmark> bmark)
{
	auto baselineExperiment = bmark->getBaseline();

	if(baselineExperiment != nullptr)
	{
		// Populate the problem space with a test fixture instantiation.
		{
			const auto testValues = baselineExperiment->getFactory()->Create()->getExperimentValues();
			const auto valueResultScale = baselineExperiment->getFactory()->Create()->getExperimentValueResultScale();

			for(auto i : testValues)
			{
				if(i.Iterations > 0)
				{
					baselineExperiment->addProblemSpace(i.Value, static_cast<double>(valueResultScale), i.Iterations);
				}
				else
				{
					baselineExperiment->addProblemSpace(i.Value, static_cast<double>(valueResultScale), baselineExperiment->getIterations());
				}
			}

			// Add a single default problem space if none was specified.
			// This is needed to get the result size later.
			if(baselineExperiment->getResultSize() == 0)
			{
				baselineExperiment->addProblemSpace(static_cast<int64_t>(TestFixture::Constants::NoProblemSpaceValue));
			}
		}

		for(size_t i = 0; i < baselineExperiment->getResultSize(); i++)
		{
			auto r = baselineExperiment->getResult(i);
			assert(r != nullptr);

			print::TableRowExperimentHeader(r->getExperiment());

			// Do a quick sample, if necessary, and adjust sample and iteration sizes, if necessary.
			if(AdjustSampleAndIterationSize(r) == true)
			{
				// Describe the beginning of the run.
				print::TableRowProblemSpaceHeader(r);

				if(ExecuteProblemSpace(r))
				{
					// Describe the end of the run.
					print::TableResult(r);
				}
			}
			else
			{
				r->setFailure(true);
			}

			celero::impl::ExperimentResultComplete(r);
		}

		celero::impl::ExperimentComplete(baselineExperiment);
	}
	else
	{
		std::cerr << "No Baseline case defined for \"" + bmark->getName() + "\".  Exiting.";
		std::exit(EXIT_FAILURE);
	}
}
Example #5
0
	void kg::ksLibrary::registerFunction( const std::shared_ptr<ksFunctionMaster>& funcMaster )
	{
		m_availableFunctions[funcMaster->getName()] = funcMaster;
	}