TransformationAbstract.h 1.67 KB
#ifndef TRANSFORMATIONABSTRACT_H
#define TRANSFORMATIONABSTRACT_H

#include <list>

#include "TransformationRequest.h"
#include "TransformationResult.h"
#include "../Application/Application.h"
#include "../DataRecord/DataRecordList.h"
#include "../RequestManager/RequestAbstract.h"

using namespace std;
using namespace TREPS::Application;
using namespace TREPS::DataRecord;
using namespace TREPS::RequestManager;

namespace TREPS
{
	namespace Transformation
	{
		class TransformationAbstractClass
		{
			public :
				TransformationAbstractClass(RequestAbstractClass *trepsRequest);

				virtual ~TransformationAbstractClass(void) = 0;

				//init request
				bool init(const char *srcFrame, const char *dstFrame, const char *srcCenter, const char *dstCenter,
					const t_Time startTime, const t_Time stopTime, const char *srcVecDef,
					const char *timeFieldId, const char *timeFormatId, const char *timePattern,
					const char *srcDataFile, const char *transformationRequest);

				//check if a frame exist for this engine
				virtual bool checkFrame(const char *frame) = 0;

				//get list of available frames for this engine
				virtual t_StringList getAvailableFrameList(void) = 0;

				//run request
				virtual bool run(const char *workingDir) = 0;

				//write request result
				bool writeResult(const char *resultPath);

				//get last error message
				string getLastError(void);

			protected :
				ApplicationClass *app;

				RequestAbstractClass *trepsRequest;

				string errorMsg;

				//get source vector list
				t_VectorList getSrcVectorsList(const char *vectorsDef, const char *srcFrame);

				TransformationRequestClass *request;

				TransformationResultClass *result;
		};
	}
}

#endif