/**
 * @author    STF 424_ITS_Test_Platform
 * @version    $id$
 */
package org.etsi.ttcn.tool.spirent.xf;

import org.etsi.ttcn.codec.core.TciCDWrapperFactory;
import org.etsi.extfunc.its.ItsExternalFunctionsProvider;
import org.etsi.ttcn.tool.spirent.codec.TciCDWrapper; // FIXME investigate this

import com.testingtech.ttcn.extension.ExternalFunctionsProvider;
import com.testingtech.ttcn.tri.ExternalFunctionsDefinition;

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

/**
 * This class provides access to the implementation of TTCN-3 external function
 */
public class ExternalFunctionsPluginProvider extends ItsExternalFunctionsProvider implements ExternalFunctionsProvider, ExternalFunctionsDefinition {

    /** 
     * Constructor
     * 
     */
    public ExternalFunctionsPluginProvider() {

    }
	
    /** 
     * Constructor
     * 
     * @param rb TTwb runtime reference
     */
    public ExternalFunctionsPluginProvider(RB rb) {
        TciCDWrapperFactory.getInstance().setImpl(new TciCDWrapper(rb)); // FIXME investigate this
    }

    /** 
     * Refer to TTwb developer's guide
     */
    @Override
    public ExternalFunctionsDefinition getExternalFunctions(RB rb) {
        return new ExternalFunctionsPluginProvider(rb); // FIXME why new ? why not returning this ?
    }
    
}
