コード例 #1
0
void createProgrammaticConfig( Map& configMap )
{
	Map innerMap;
	ElementList elementList;
		//APIQA
	elementList.addAscii( "DefaultNiProvider", "Provider_1" );

	innerMap.addKeyAscii( "Provider_1", MapEntry::AddEnum, ElementList()
		.addAscii( "Channel", "Channel_10" )
		.addAscii( "Directory", "Directory_1" )
		.addAscii( "Logger", "Logger_1" )
		.addUInt( "CatchUnhandledException", 0 )
		.addUInt( "ItemCountHint", 100 )
		.addInt( "DispatchTimeoutApiThread", 1000)
		.addUInt( "MaxDispatchCountApiThread", 500 )
		.addUInt( "MaxDispatchCountUserThread", 500 )
		.addUInt( "MergeSourceDirectoryStreams", 1)
		.addInt( "PipePort", 9001 )
		.addInt( "ReconnectAttemptLimit", 10)
		.addInt( "ReconnectMaxDelay", 5000)
		.addInt( "ReconnectMinDelay", 1000)
		.addUInt( "RecoverUserSubmitSourceDirectory", 1)
		.addUInt( "RemoveItemsOnDisconnect", 1)
		.addInt("RequestTimeout", 15000)
		.addUInt( "ServiceCountHint", 100 )
		.addAscii("XmlTraceFileName", "NiProvXMLTrace")
		.addInt("XmlTraceMaxFileSize", 50000000)
		.addUInt("XmlTraceToFile", 1)
		.addUInt("XmlTraceToStdout", 0)
		.addUInt("XmlTraceToMultipleFiles", 1)
		.addUInt("XmlTraceWrite", 1)
		.addUInt("XmlTraceRead", 1)
		.addUInt("XmlTracePing", 1)
		.addUInt("XmlTraceHex", 1)
		.addUInt( "LoginRequestTimeOut" , 45000 )
		.addUInt( "RefreshFirstRequired", 1 ).complete() ).complete();
		//END APIQA
	elementList.addMap( "NiProviderList", innerMap );

	elementList.complete();
	innerMap.clear();

	configMap.addKeyAscii( "NiProviderGroup", MapEntry::AddEnum, elementList );

	elementList.clear();

	innerMap.addKeyAscii( "Channel_10", MapEntry::AddEnum,
		ElementList()
		.addEnum( "ChannelType", 0 )
		.addUInt( "GuaranteedOutputBuffers", 5000 )
		.addUInt( "ConnectionPingTimeout", 30000 )
		.addAscii( "Host", "localhost" )
		.addAscii( "Port", "14003" )
		//APIQA
		.addEnum( "CompressionType", 0 )
		.addAscii("InterfaceName", "providerInterface")
		.addUInt("CompressionThreshold", 100)
		.addUInt("HighWaterMark", 6144)
		.addUInt("NumInputBuffers", 10)
		.addUInt("SysRecvBufSize", 0)
		.addUInt("SysSendBufSize", 0)
		//END APIQA
		.addUInt( "TcpNodelay", 1 ).complete() ).complete();

	elementList.addMap( "ChannelList", innerMap );

	elementList.complete();
	innerMap.clear();

	configMap.addKeyAscii( "ChannelGroup", MapEntry::AddEnum, elementList );

	elementList.clear();

	innerMap.addKeyAscii( "Logger_1", MapEntry::AddEnum,
						ElementList()
						.addEnum( "LoggerType", 1 )
						.addAscii( "FileName", "logFile" )
					    //APIQA	
						.addEnum( "LoggerSeverity", 0 ).complete()).complete();

	elementList.addMap( "LoggerList", innerMap );

	elementList.complete();
	innerMap.clear();

	configMap.addKeyAscii( "LoggerGroup", MapEntry::AddEnum, elementList );
	elementList.clear();

	innerMap.addKeyAscii( "Dictionary_1", MapEntry::AddEnum,
						ElementList()
						.addEnum( "DictionaryType", 1 )
						.addAscii( "RdmFieldDictionaryItemName", "RWFFld" )
						.addAscii( "EnumTypeDefItemName", "RWFEnum" ).complete()).complete();

	elementList.addMap( "DictionaryList", innerMap );
	elementList.complete();
	innerMap.clear();

	configMap.addKeyAscii( "DictionaryGroup", MapEntry::AddEnum, elementList );
	elementList.clear();

	Map serviceMap;
	serviceMap.addKeyAscii( "NI_PUB", MapEntry::AddEnum,
		ElementList()
		.addElementList( "InfoFilter",
			ElementList().addUInt( "ServiceId", 0 )
			.addAscii( "Vendor", "company name" )
			.addUInt( "IsSource", 0 )
			.addUInt( "AcceptingConsumerStatus", 0 )
			.addUInt( "SupportsQoSRange", 0 )
			.addUInt( "SupportsOutOfBandSnapshots", 0 )
			.addAscii( "ItemList", "#.itemlist" )
			.addArray( "Capabilities",
				OmmArray().addAscii( "MMT_DICTIONARY" )
				.addAscii( "MMT_MARKET_PRICE" )
				.addAscii( "MMT_MARKET_BY_ORDER" )
				.complete() )
			.addArray( "DictionariesUsed",
				OmmArray().addAscii( "Dictionary_1" )
				.complete() )
			.addSeries( "QoS",
				Series()
				.add(
					ElementList().addAscii( "Timeliness", "Timeliness::RealTime" )
					.addAscii( "Rate", "Rate::TickByTick" )
					.complete() )
				.add(
					ElementList().addAscii( "Timeliness", "Timeliness::InexactDelayed" )
					.addAscii( "Rate", "Rate::JustInTimeConflated" )
					.complete() )
				.complete() )
			.complete() )

		.addElementList( "StateFilter",
			ElementList().addUInt( "ServiceState", 1 )
			.addUInt( "AcceptingRequests", 1 )
			.complete() )
		.complete() )
	.complete();

	innerMap.addKeyAscii( "Directory_1", MapEntry::AddEnum, serviceMap ).complete();

	elementList.clear();
	elementList.addAscii( "DefaultDirectory", "Directory_1" );
	elementList.addMap( "DirectoryList", innerMap ).complete();

	configMap.addKeyAscii( "DirectoryGroup", MapEntry::AddEnum, elementList ).complete();
}
コード例 #2
0
void createProgrammaticConfig( Map& configMap )
{
	Map innerMap;
	ElementList elementList;

	elementList.addAscii( "DefaultNiProvider", "Provider_4" );

	innerMap.addKeyAscii( "Provider_4", MapEntry::AddEnum, ElementList()
		.addAscii( "Channel", "Channel_13" )
		.addAscii( "Directory", "Directory_1" )
		.addAscii( "Logger", "Logger_1" )
		.addUInt( "XmlTraceToStdout", 1 )
		.addUInt( "RefreshFirstRequired", 1 ).complete() ).complete();

	elementList.addMap( "NiProviderList", innerMap );

	elementList.complete();
	innerMap.clear();

	configMap.addKeyAscii( "NiProviderGroup", MapEntry::AddEnum, elementList );

	elementList.clear();

	innerMap.addKeyAscii( "Channel_13", MapEntry::AddEnum,
		ElementList()
		.addEnum( "ChannelType", 1 )
		.addUInt( "GuaranteedOutputBuffers", 5000 )
		.addUInt( "ConnectionPingTimeout", 30000 )
		.addAscii( "Host", "localhost" )
		.addAscii( "Port", "14002" )
		.addAscii( "ObjectName", "P_ObjectName")
		.addAscii( "ProxyHost", "proxyHostToConnectTo")
		.addAscii("ProxyPort", "proxyPortToConnectTo" )
		.addUInt( "TcpNodelay", 1 ).complete() ).complete();

	elementList.addMap( "ChannelList", innerMap );

	elementList.complete();
	innerMap.clear();

	configMap.addKeyAscii( "ChannelGroup", MapEntry::AddEnum, elementList );

	elementList.clear();

	innerMap.addKeyAscii( "Logger_1", MapEntry::AddEnum,
						ElementList()
						.addEnum( "LoggerType", 1 )
						.addAscii( "FileName", "logFile" )
						.addEnum( "LoggerSeverity", 0 ).complete()).complete();

	elementList.addMap( "LoggerList", innerMap );

	elementList.complete();
	innerMap.clear();

	configMap.addKeyAscii( "LoggerGroup", MapEntry::AddEnum, elementList );
	elementList.clear();

	Map serviceMap;
	serviceMap.addKeyAscii( "TEST_NI_PUB", MapEntry::AddEnum,
		ElementList()
		.addElementList( "InfoFilter",
			ElementList().addUInt( "ServiceId", 1 )
			.addAscii( "Vendor", "company name" )
			.addUInt( "IsSource", 0 )
			.addUInt( "AcceptingConsumerStatus", 0 )
			.addUInt( "SupportsQoSRange", 0 )
			.addUInt( "SupportsOutOfBandSnapshots", 0 )
			.addAscii( "ItemList", "#.itemlist" )
			.addArray( "Capabilities",
				OmmArray().addAscii( "MMT_MARKET_PRICE" )
				.addAscii( "MMT_MARKET_BY_PRICE" )
				.addAscii( "200" )
				.complete() )
			.addArray( "DictionariesUsed",
				OmmArray().addAscii( "Dictionary_1" )
				.complete() )
			.addSeries( "QoS",
				Series()
				.add(
					ElementList().addAscii( "Timeliness", "Timeliness::RealTime" )
					.addAscii( "Rate", "Rate::TickByTick" )
					.complete() )
				.add(
					ElementList().addUInt("Timeliness", 100)
					.addUInt("Rate", 100)
					.complete())
				.complete() )
			.complete() )

		.addElementList( "StateFilter",
			ElementList().addUInt( "ServiceState", 1 )
			.addUInt( "AcceptingRequests", 1 )
			.complete() )
		.complete() )
	.complete();

	innerMap.addKeyAscii( "Directory_1", MapEntry::AddEnum, serviceMap ).complete();

	elementList.clear();
	elementList.addAscii( "DefaultDirectory", "Directory_1" );
	elementList.addMap( "DirectoryList", innerMap ).complete();

	configMap.addKeyAscii( "DirectoryGroup", MapEntry::AddEnum, elementList ).complete();
}