コード例 #1
0
ファイル: Item.cpp プロジェクト: iangodin/constructor
void
Item::extractVariables( VariableSet &vs ) const
{
	ItemPtr i = getParent();
	if ( i )
		i->extractVariables( vs );
	for ( auto x = myVariables.begin(); x != myVariables.end(); ++x )
		vs.emplace( std::make_pair( x->first, x->second ) );
}
コード例 #2
0
ファイル: Item.cpp プロジェクト: iangodin/constructor
void
Item::extractVariablesExcept( VariableSet &vs, const std::set<std::string> &vl ) const
{
	ItemPtr i = getParent();
	if ( i )
		i->extractVariablesExcept( vs, vl );
	for ( auto x = myVariables.begin(); x != myVariables.end(); ++x )
	{
		if ( vl.find( x->first ) == vl.end() )
			vs.emplace( std::make_pair( x->first, x->second ) );
	}
}
コード例 #3
0
ファイル: Variable.cpp プロジェクト: iangodin/constructor
void merge( VariableSet &vs, const VariableSet &other )
{
	if ( vs.empty() )
		vs = other;
	else
	{
		for ( auto i: other )
		{
			auto cur = vs.find( i.first );
			if ( cur == vs.end() )
			{
				vs.emplace( std::make_pair( i.first, i.second ) );
			}
			else
				cur->second.merge( i.second );
		}
	}
}