Пример #1
0
vector<Spec *> Reac::getAllSpecs(void) const
{
    SpecPVec specs = SpecPVec();
	bool first_occ = true;

	SpecPVec lhs = getLHS();
	SpecPVecCI l_end = lhs.end();
	for (SpecPVecCI l = lhs.begin(); l != l_end; ++l)
	{
		first_occ = true;
		SpecPVecCI s_end = specs.end();
		for (SpecPVecCI s = specs.begin(); s != s_end; ++s)
		{
			if ((*s) == (*l))
			{
				first_occ = false;
				break;
			}
		}
		if (first_occ == true) specs.push_back((*l));
	}

	SpecPVec rhs = getRHS();
	SpecPVecCI r_end = rhs.end();
	for (SpecPVecCI r = rhs.begin(); r != r_end; ++r)
	{
		first_occ = true;
		SpecPVecCI s_end = specs.end();
		for (SpecPVecCI s = specs.begin(); s != s_end; ++s)
		{
			if ((*s) == (*r))
			{
				first_occ = false;
				break;
			}
		}
		if (first_occ == true) specs.push_back((*r));
	}

	return specs;
}
Пример #2
0
vector<Spec *> Diff::getAllSpecs(void) const
{
    SpecPVec specs = SpecPVec();
	specs.push_back(pLig);
	return specs;
}