/*!
**********************************************************************
@file OperationSequencer.js

Copyright 2003-2006 Adobe Systems Incorporated.                     
All Rights Reserved.                                                
                                                                    
NOTICE: All information contained herein is the property of Adobe   
Systems Incorporated.                                                                                                                    

***********************************************************************
*/

/**
@brief	Given a list of payloads and their operations, determine the optimal instruction order. 

*/

/** 
Encapsulates a payload operation that will be forwarded to the container
*/
function PayloadOperation(inAdobeCode, inOperation, inPropertyMap)
{
	/** AdobeCode of operation */
	this.adobeCode = inAdobeCode;
	/** Operation type [install, remove, repair] */
	this.operationType = inOperation;
	/** Additional parameters as anonymous Object */
	this.operationParameters = inPropertyMap;
}
function OperationSequencer(inInstallerSession)
{	
	this.GetOperationSequence = function()
	{
		// Create a priority heap of the dependent operations.  This amounts to traversing the
		// InstallerSession graph and ordering them so that the payload with the 
		// most dependencies is installed first.  This may amount to nothing more
		// than tweaking the CAPS store, but that's still acceptable
		var arrOperations = new Array();
		
		// The first thing to do is to get the interdependencies between all payloads
		for (var eachAdobeCode in inInstallerSession.payloadMap)
		{
			var eachPayload = inInstallerSession.payloadMap[eachAdobeCode];
			if (eachPayload.requiresPayloads != null)
			{
				for (var eachDependentAdobeCodein eachPayload.dependsPayloads)
				{
					
					
				}
				
			}
			
		}
		
		return arrOperations;
	}
	
}