AMDAPlugin.cc 2.15 KB
/*
 * AMDAPlugin.cc
 *
 *  Created on: Nov 21, 2014
 *      Author: AKKA
 */

//=============================================================================
// Include section
//=============================================================================

// Standard libraries include files
//-----------------------------------------------------------------------------
#include <iostream>

// Include oriented definitions 
//-----------------------------------------------------------------------------

// Module Kernel include files
//-----------------------------------------------------------------------------

#include "NodeCfg.hh"
#include "XMLParameterConfigurator.hh"
#include "ServicesServer.hh"
#include "ParameterManager.hh"
#include "PluginManager.hh"
#include "ParamGetLocalFile.hh"
#include "GetLocalFileNode.hh"
#include "VirtualInstrumentManager.hh"

using namespace AMDA::Parameters;
using namespace AMDA::XMLParameterConfigurator;

// Other modules include files
//-----------------------------------------------------------------------------

//=============================================================================
// Library function
//=============================================================================

/**
 * Retrieve the Plugin version we're going to expect
 */
extern "C" const char* getPluginVersion() 
{
	return "(Version)";
}

/**
 * Tells us to register our functionality to an engine kernel
 */
extern "C" void registerPlugin(AMDA::Plugins::PluginManager & pm)
{
	ParamGetFactory fact = boost::factory<AMDA::LocalFileInterface::ParamGetLocalFile*>();
	ServicesServer *servicesServer = ServicesServer::getInstance();
	servicesServer->addParamGetFactory("LOCALFILE", fact);
                    servicesServer->linkParamGetWithPlugin("LOCALFILE", pm.getCurrentPluginPath());
	XMLParameterConfigurator* lXMLConf =  dynamic_cast<XMLParameterConfigurator*>(servicesServer->getConfigurator().get());
	lXMLConf->addNodeParser("param/get/localvi",AMDA::XMLConfigurator::NodeCfgSPtr(new AMDA::XMLParameterConfigurator::GetLocalFileNode));
}

extern "C" void unregisterPlugin()
{
	AMDA::LocalFileInterface::VirtualInstrumentManager::releaseInstance();
}