// Commit //------------------------------------------------------------------------------ /*virtual*/ bool FunctionAlias::Commit( NodeGraph & nodeGraph, const BFFIterator & funcStartIter ) const { if ( nodeGraph.FindNode( m_AliasForFunction ) ) { Error::Error_1100_AlreadyDefined( funcStartIter, this, m_AliasForFunction ); return false; } AliasNode * aliasNode = nodeGraph.CreateAliasNode( m_AliasForFunction ); if ( !PopulateProperties( nodeGraph, funcStartIter, aliasNode ) ) { return false; } return aliasNode->Initialize( nodeGraph, funcStartIter, this ); }
// ProcessAlias //------------------------------------------------------------------------------ bool Function::ProcessAlias( NodeGraph & nodeGraph, const BFFIterator & iter, Dependencies & nodesToAlias ) const { if ( m_AliasForFunction.IsEmpty() ) { return true; // no alias required } // check for duplicates if ( nodeGraph.FindNode( m_AliasForFunction ) ) { Error::Error_1100_AlreadyDefined( iter, this, m_AliasForFunction ); return false; } // create an alias against the node AliasNode * an = nodeGraph.CreateAliasNode( m_AliasForFunction ); an->m_StaticDependencies = nodesToAlias; // TODO: make this use m_Targets & Initialize() // clear the string so it can't be used again m_AliasForFunction.Clear(); return true; }