本文整理汇总了C++中ReqMsg类的典型用法代码示例。如果您正苦于以下问题:C++ ReqMsg类的具体用法?C++ ReqMsg怎么用?C++ ReqMsg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ReqMsg类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processInvalidItemRequest
void AppClient::processInvalidItemRequest( const ReqMsg& reqMsg, const OmmProviderEvent& event )
{
event.getProvider().submit( StatusMsg().name( reqMsg.getName() ).serviceName( reqMsg.getServiceName() ).
domainType( reqMsg.getDomainType() ).
state( OmmState::ClosedEnum, OmmState::SuspectEnum, OmmState::NotFoundEnum, "Item not found" ),
event.getHandle() );
}
示例2: processSymbolListRequest
//APIQA
void AppClient::processSymbolListRequest( const ReqMsg& reqMsg, const OmmProviderEvent& event ) {
Map m;
for (int i = 0; i < symbolListSize; ++i) {
if (i % 25 == 0)
std::cout << std::endl << i << ' ';
else
std::cout << '.';
std::ostringstream oss;
oss << "A" << i;
try {
m.addKeyAscii( EmaString(oss.str().c_str(), oss.str().length()), MapEntry::AddEnum, FieldList().complete() );
}
catch (const OmmInvalidUsageException& e) {
std::cout << "caught OmmInvalidUsageException [" << e.getText() << ']' << std::endl;
}
catch (const OmmException& e) {
std::cout << "caught OmmException [" << e.getExceptionTypeAsString() << '|'
<< e.getText() << ']' << std::endl;
}
}
m.complete();
event.getProvider()
.submit( RefreshMsg().name( reqMsg.getName() ).serviceName( reqMsg.getServiceName() )
.domainType( reqMsg.getDomainType() )
.solicited( true ).state( OmmState::OpenEnum, OmmState::OkEnum, OmmState::NoneEnum, "Refresh Completed" ).
payload( m.complete() ).complete(), event.getHandle() );
/* payload( Map().
addKeyAscii( "A", MapEntry::AddEnum ).
addKeyAscii( "B", MapEntry::AddEnum ).
complete() ), event.getHandle() );
*/
std::cout << "processSymbolListRequest" << std::endl;
}
示例3: main
int main( int argc, char* argv[] )
{
try {
AppClient client;
OmmConsumer consumer( OmmConsumerConfig().host( "localhost:14002" ).username( "user" ) );
ReqMsg reqMsg;
EmaString itemName;
for ( UInt32 idx = 0; idx < 1000; ++idx )
{
itemName.set( "RTR", 3 ).append( idx ).append( ".N" );
reqMsg.serviceName( "DIRECT_FEED" ).name( itemName );
consumer.registerClient( reqMsg, client );
reqMsg.clear();
}
for ( UInt32 idx = 0; idx < 300; ++idx )
{
sleep( 1000 );
cout << "total refresh count: " << refreshCount << "\ttotal status count: " << statusCount << "\tupdate rate (per sec): " << updateCount << endl;
updateCount = 0;
}
} catch ( const OmmException& excp ) {
cout << excp << endl;
}
return 0;
}
示例4: processDictionaryRequest
void AppClient::processDictionaryRequest(const ReqMsg& reqMsg, const OmmProviderEvent& event)
{
result = false;
refreshMsg.clear().clearCache( true );
if ( reqMsg.getName() == "RWFFld" )
{
currentValue = dataDictionary.getMinFid();
while ( !result )
{
result = dataDictionary.encodeFieldDictionary( series, currentValue, reqMsg.getFilter(), fragmentationSize );
event.getProvider().submit( refreshMsg.name( reqMsg.getName() ).serviceName( reqMsg.getServiceName() ).domainType( MMT_DICTIONARY ).
filter( reqMsg.getFilter() ).payload( series ).complete( result ).solicited( true ), event.getHandle() );
refreshMsg.clear();
}
}
else if ( reqMsg.getName() == "RWFEnum" )
{
currentValue = 0;
while ( !result )
{
result = dataDictionary.encodeEnumTypeDictionary( series, currentValue, reqMsg.getFilter(), fragmentationSize );
event.getProvider().submit( refreshMsg.name( reqMsg.getName() ).serviceName( reqMsg.getServiceName() ).domainType( MMT_DICTIONARY ).
filter( reqMsg.getFilter() ).payload( series ).complete( result ).solicited( true ), event.getHandle() );
refreshMsg.clear();
}
}
}
示例5: processLoginRequest
void AppClient::processLoginRequest( const ReqMsg& reqMsg, const OmmProviderEvent& ommEvent )
{
ommEvent.getProvider().submit(RefreshMsg().domainType(MMT_LOGIN).name(reqMsg.getName()).nameType(USER_NAME).complete().
solicited( true ).state( OmmState::OpenEnum, OmmState::OkEnum, OmmState::NoneEnum, "Login accepted" ),
ommEvent.getHandle());
loginHandle = ommEvent.getHandle();
cout << endl << "Handle: " << ommEvent.getHandle() << " Closure: " << ommEvent.getClosure() << endl;
cout << endl << "Item Name: " << (reqMsg.hasName() ? reqMsg.getName() : EmaString("<not set>")) << endl
<< "Service Name: " << (reqMsg.hasServiceName() ? reqMsg.getServiceName() : EmaString("<not set>"));
}
示例6: processMarketPriceRequest
void AppClient::processMarketPriceRequest( const ReqMsg& reqMsg, const OmmProviderEvent& event )
{
if ( itemHandle != 0 )
{
processInvalidItemRequest( reqMsg, event );
return;
}
try{
event.getProvider().submit( refreshMsg.clear().name(reqMsg.getName()).serviceId(5).solicited(true).
state( OmmState::OpenEnum, OmmState::OkEnum, OmmState::NoneEnum, "Refresh Completed" ).
payload( FieldList().
addReal( 22, 3990, OmmReal::ExponentNeg2Enum ).
addReal( 25, 3994, OmmReal::ExponentNeg2Enum ).
addReal( 30, 9, OmmReal::Exponent0Enum ).
addReal( 31, 19, OmmReal::Exponent0Enum ).
complete() ).
complete(), event.getHandle() );
itemHandle = event.getHandle();
}
catch ( const OmmException& excp )
{
cout << excp << endl;
}
}
示例7: onReissue
void AppClient::onReissue(const ReqMsg& reqMsg, const OmmProviderEvent& event)
{
switch (reqMsg.getDomainType())
{
case MMT_DICTIONARY:
processDictionaryRequest(reqMsg, event);
break;
default:
processInvalidItemRequest(reqMsg, event);
break;
}
}
示例8: processMarketPriceRequest
void AppClient::processMarketPriceRequest( const ReqMsg& reqMsg, const OmmProviderEvent& event )
{
if ( itemHandle != 0 )
{
processInvalidItemRequest( reqMsg, event );
return;
}
event.getProvider().submit( RefreshMsg().name( reqMsg.getName() ).serviceName( reqMsg.getServiceName() ).
state( OmmState::OpenEnum, OmmState::OkEnum, OmmState::NoneEnum, "Refresh Completed" ).solicited( true ).
payload( FieldList().
addAscii( 3, reqMsg.getName() ).
addEnum( 15, 840 ).
addReal( 21, 3900, OmmReal::ExponentNeg2Enum ).
addReal( 22, 3990, OmmReal::ExponentNeg2Enum ).
addReal( 25, 3994, OmmReal::ExponentNeg2Enum ).
addReal( 30, 9, OmmReal::Exponent0Enum ).
addReal( 31, 19, OmmReal::Exponent0Enum ).
complete() ).
complete(), event.getHandle() );
itemHandle = event.getHandle();
}
示例9: onReqMsg
void AppClient::onReqMsg( const ReqMsg& reqMsg, const OmmProviderEvent& event )
{
switch ( reqMsg.getDomainType() )
{
case MMT_LOGIN:
processLoginRequest( reqMsg, event );
break;
case MMT_MARKET_PRICE:
processMarketPriceRequest( reqMsg, event );
break;
default:
processInvalidItemRequest( reqMsg, event );
break;
}
}
示例10: open
bool DirectoryItem::open( const ReqMsg& reqMsg )
{
const ReqMsgEncoder& reqMsgEncoder = static_cast<const ReqMsgEncoder&>( reqMsg.getEncoder() );
const Directory* pDirectory = 0;
if ( reqMsgEncoder.hasServiceName() )
{
pDirectory = _ommBaseImpl.getDirectoryCallbackClient().getDirectory( reqMsgEncoder.getServiceName() );
if ( !pDirectory )
{
EmaString temp( "Service name of '" );
temp.append( reqMsgEncoder.getServiceName() ).append( "' is not found." );
_closedStatusInfo = new ClosedStatusInfo( this, reqMsgEncoder, temp );
new TimeOut( _ommBaseImpl, 1000, ItemCallbackClient::sendItemClosedStatus, _closedStatusInfo, true );
return true;
}
}
else
{
if ( reqMsgEncoder.getRsslRequestMsg()->msgBase.msgKey.flags & RSSL_MKF_HAS_SERVICE_ID )
{
pDirectory = _ommBaseImpl.getDirectoryCallbackClient().getDirectory( reqMsgEncoder.getRsslRequestMsg()->msgBase.msgKey.serviceId );
if ( !pDirectory )
{
EmaString temp( "Service id of '" );
temp.append( reqMsgEncoder.getRsslRequestMsg()->msgBase.msgKey.serviceId ).
append( "' is not found." );
_closedStatusInfo = new ClosedStatusInfo( this, reqMsgEncoder, temp );
new TimeOut( _ommBaseImpl, 1000, ItemCallbackClient::sendItemClosedStatus, _closedStatusInfo, true );
return true;
}
}
}
_pDirectory = pDirectory;
return submit( reqMsgEncoder.getRsslRequestMsg() );
}
示例11: submit
bool LoginItem::modify( const ReqMsg& reqMsg )
{
return submit( static_cast<const ReqMsgEncoder&>( reqMsg.getEncoder() ).getRsslRequestMsg() );
}
示例12: processLoginRequest
void AppClient::processLoginRequest( const ReqMsg& reqMsg, const OmmProviderEvent& event )
{
event.getProvider().submit(RefreshMsg().domainType(MMT_LOGIN).name(reqMsg.getName()).nameType(USER_NAME).complete().
attrib( ElementList().complete() ).solicited( true ).state( OmmState::OpenEnum, OmmState::OkEnum, OmmState::NoneEnum, "Login accepted" ) ,
event.getHandle() );
}