/*******************************************************************************
 * Copyright (c) 2004, 2005 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.data.engine.olap.impl.query;

import java.io.IOException;

import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.impl.StopSign;
import org.eclipse.birt.data.engine.olap.api.query.ICubeOperation;
import org.eclipse.birt.data.engine.olap.api.query.ICubeQueryDefinition;
import org.eclipse.birt.data.engine.olap.data.api.IAggregationResultSet;
import org.eclipse.birt.data.engine.olap.query.view.CalculatedMember;

/**
 * A prepared cube operation
 */
public interface IPreparedCubeOperation
{

	/**
	 * 
	 * @return the original cube operation
	 */
	ICubeOperation getCubeOperation( );

	/**
	 * calculatedMembers are used to locate IAggregationResultSet for the new
	 * bindings introduced from ICubeOperation
	 * 
	 * @return new calculatedMembers introduced from the cube operation.
	 */
	CalculatedMember[] getNewCalculatedMembers( );

	/**
	 * execute the operation based on sources
	 * 
	 * @param cubeQueryDefn
	 *            cube query definition that the operation belongs to
	 * @param sources:
	 *            the data to be operated on
	 * @param stopSign
	 * @return
	 * @throws IOException
	 * @throws BirtException
	 */
	IAggregationResultSet[] execute( ICubeQueryDefinition cubeQueryDefn,
			IAggregationResultSet[] sources, StopSign stopSign )
			throws IOException, BirtException;
}
