/**
 * @author	STF 424_ITS_Test_Platform
 * @version    $URL$
 *             $Id$
 */
package org.etsi.its.tool.testingtech;

import org.etsi.codec.TCIWrapperFactory;
import org.etsi.its.codec.ttcn.LibIts_Interface.LibIts_InterfaceCodec;
import org.etsi.tool.testingtech.TTWBCodecSupport;
import org.etsi.ttcn.tci.TciCDProvided;

import com.testingtech.ttcn.extension.CodecProvider;
import com.testingtech.util.plugin.PluginInitException;

import de.tu_berlin.cs.uebb.muttcn.runtime.RB;

/** 
 * This is the main entry point for Its codec
 */
public class LibIts_InterfaceCodecProvider implements CodecProvider {

	/** 
	 * This method provides the codec associated to the specified encoding identifier
	 * 
	 * @param rb TTwb Runtime reference
	 * @param encodingName The name of the encoding, specified by the TTCN-3 key words 'with/encode'
	 * @return The codec associated to the specified encoding identifier
	 */
	@Override
	public TciCDProvided getCodec(RB rb, String encodingName)
			throws PluginInitException {
		//TTWBCodecSupport.setCodec(new BaseCodec(rb));
		TCIWrapperFactory.setImpl(new TTWBCodecSupport(rb)); // FIXME Find a unique location to place this code
		return new LibIts_InterfaceCodec(rb.getTciCDRequired());
	}

}
