Execution Engine - Header File

Created: 6/12/1996

File: exec.h
Author: Ramana Yerneni


// File: exec.h
// This file contains the prototypes for the main functions of the 
// execution engine of the Tsimmis mediators and wrappers.

#ifndef EXEC_H
#define  EXEC_H

// #include "btable.h"	// for {bTable}.
class bTable;		// instead of including btable.h
#include "pdp.h"	// for {optype, consobjtype, condlisttype}.
#include "tmtypes.h"	// for {TM_Object}.

/*
 * Function: PostProcess
 * Usage: answer = PostProcess(sourceanswer, headtemp, tailtemp, error);
 * This function does the post processing of the Wrappers.  It takes a top 
 * level answer object (the one the Wrapper got from its source) and the 
 * head and tail templates of the Wrapper query. It will extract the bindings
 * from the answer objects pointed to by sourceanswer using the tailtemp. It
 * will then use these bindings to construct a new top level object that 
 * points to all the answer objects whose structure is described by headtemp. 
 * The function returns a pointer to this top level object. 
 * If error != 0, there is an error, and the function returns NULL.
 * For more information on consobjtype and condlisttype, please refer to pdp.h.
 * For more information on TM_Object, please refer to tmtypes.h.
*/
TM_Object *PostProcess(TM_Object *sourceanswer, 
		       consobjtype *headtemp,
                       condlisttype *tailtemp, 
                       int &error);
			

/*
 * Function: Execute
 * Usage: answer = Execute(plan, error);
 * This function executes a given "physical" query plan. It returns a 
 * pointer to the top level object that points to all the answers to the 
 * query plan. The query plan is specified by the parameter "plan". An 
 * error value is set by the function through the reference paramater "error".
 * For more information on optype, please refer to pdp.h.
 * For more information on TM_Object, please refer to tmtypes.h.
*/
TM_Object *Execute(optype *plan, int &error);

#endif