An example DIS Broker plugin that overrides some of the existing DIS object and interaction translators.
Plugins are loaded from their respective brokers' plugin directories. Default plugin directories for each broker are a subfolder in the 'plugins' directory that shares the name of the broker (For example, the DIS Broker's plugin directory is 'plugins/disBroker'. The plugin directory is a broker setting, and can be configured on a broker-by-broker basis.
When a broker is run, it checks the plugin directory for shared libraries and if they are valid plugins, loads them and calls their initialization method.
The example plugin library installs and builds into your install's runtime library folder (bin on windows, lib on linux), and must be manually copied into the plugins/disBroker directory if you want to test it with the DIS Broker.
#pragma once
#ifdef _WIN32
# ifdef DT_DLL_BROKERPLUGIN
# undef DT_DLL_BROKERPLUGIN
# define DT_DLL_BROKERPLUGIN __declspec ( dllexport )
# else
# define DT_DLL_BROKERPLUGIN __declspec ( dllimport )
# endif
#else
# define DT_DLL_BROKERPLUGIN
#endif
#include <dllExport.h>
#define DT_VRX_PLUGIN_EXPORT_MACRO DT_DLL_BROKERPLUGIN
using namespace MAKVrExchange::DtDisBroker;
{
if ( ! disBroker )
{
DtWarn << "Broker is not a DtDisBroker! Aborting plugin init." << std::endl;
return false;
}
return true;
}
{
DtInfo << "Perform additional reload actions here." << std::endl;
}
{
DtInfo << "Perform post-initialization actions here." << std::endl;
}
#pragma once
#include <dllExport.h>
namespace MAKVrExchange
{
namespace DtDisBroker
{
class DtDisBroker;
}
}
{
public:
const DtEntityStateRepository& source,
const DtReflectedEntity& refObj );
DtEntityStateRepository* dest,
private:
};
#include <vl/entityStateRepository.h>
#include <vlpi/disEnums.h>
using namespace MAKVrExchange;
{
}
{
}
const DtEntityStateRepository& src, const DtReflectedEntity& refObj )
{
dest->setGuise( "DIS Force Guise" );
dest->setAlgorithm( DtDrStatic );
dest->setAntennaRaised( true );
return dest;
}
{
dest->setAlgorithm( DtDrStatic );
dest->setAntennaRaised( true );
return dest;
}
#pragma once
#include <dllExport.h>
namespace MAKVrExchange
{
namespace DtDisBroker
{
class DtDisBroker;
}
}
{
public:
const DtDataInteraction& source );
private:
};
#include <vl/exerciseConn.h>
#include <vlutil/vlTime.h>
using namespace MAKVrExchange;
{
}
{
}
{
return destination;
}