コード例 #1
0
ファイル: Consumer.cpp プロジェクト: HaroldWoods/Elektron-SDK
void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& ommEvent )
{
    cout << endl << "Received:    " << "UpdateMsg" << endl << "Handle: " << ommEvent.getHandle() << " Closure:     " << ommEvent.getClosure() << endl;

    if ( updateMsg.hasMsgKey() )
        cout << "Item Name: " << updateMsg.getName() << endl << "Service Name: " << ( updateMsg.hasServiceName() ? updateMsg.getServiceName() : EmaString( "not set" ) ) << endl;

    decode( updateMsg );
}
コード例 #2
0
void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& ommEvent )
{
	cout << endl << "Handle: " << ommEvent.getHandle() << " Closure: " << ommEvent.getClosure() << endl;

	cout << endl << "Item Name: " << ( updateMsg.hasName() ? updateMsg.getName() : EmaString( "<not set>" ) ) << endl
		<< "Service Name: " << (updateMsg.hasServiceName() ? updateMsg.getServiceName() : EmaString( "<not set>" ) ) << endl;

	decode( updateMsg );
}
コード例 #3
0
void AppClient::onStatusMsg( const StatusMsg& statusMsg, const OmmConsumerEvent& ommEvent ) 
{
	cout << endl << "Item Name: " << ( statusMsg.hasName() ? statusMsg.getName() : EmaString( "<not set>" ) ) << endl
		<< "Service Name: " << (statusMsg.hasServiceName() ? statusMsg.getServiceName() : EmaString( "<not set>" ) );

	if ( statusMsg.hasState() )
		cout << endl << "Item State: " << statusMsg.getState().toString() << endl;

	cout << "Item Handle: " << ommEvent.getHandle() << endl << "Item Closure: " << ommEvent.getClosure() << endl;
}
コード例 #4
0
void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& ommEvent ) 
{
	cout << endl << "Item Name: " << ( updateMsg.hasName() ? updateMsg.getName() : EmaString( "<not set>" ) ) << endl
		<< "Service Name: " << (updateMsg.hasServiceName() ? updateMsg.getServiceName() : EmaString( "<not set>" ) );

	cout << endl << "Item Handle: " << ommEvent.getHandle() << endl << "Item Closure: " << ommEvent.getClosure() << endl;

	if ( DataType::FieldListEnum == updateMsg.getPayload().getDataType() )
		decode( updateMsg.getPayload().getFieldList() );
}
コード例 #5
0
ファイル: Consumer.cpp プロジェクト: HaroldWoods/Elektron-SDK
void AppClient::onStatusMsg( const StatusMsg& statusMsg, const OmmConsumerEvent& ommEvent )
{
	cout << "Received Status. Item Handle: " << ommEvent.getHandle() << " Closure: " << ommEvent.getClosure() << endl;

	if ( statusMsg.hasMsgKey() )
		cout << endl << "Item Name: " << statusMsg.getName() << endl << "Service Name: " << statusMsg.getServiceName();
	
	if ( statusMsg.hasState() )
		cout << endl << "Item State: " << statusMsg.getState().toString() << endl;
}
コード例 #6
0
ファイル: Consumer.cpp プロジェクト: HaroldWoods/Elektron-SDK
void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& ommEvent )
{
	cout << endl << "Received Update. Item Handle: " << ommEvent.getHandle() << " Closure: " << ommEvent.getClosure() << endl;

	if ( updateMsg.hasMsgKey() )
		cout << endl << "Item Name: " << updateMsg.getName() << endl << "Service Name: " << updateMsg.getServiceName() << endl;

	if ( DataType::FieldListEnum == updateMsg.getPayload().getDataType() )
		decode( updateMsg.getPayload().getFieldList() );
}
コード例 #7
0
void AppClient::onRefreshMsg( const RefreshMsg& refreshMsg, const OmmConsumerEvent& ommEvent )
{
	cout << endl << "Handle: " << ommEvent.getHandle() << " Closure: " << ommEvent.getClosure() << endl;

	cout << endl << "Item Name: " << ( refreshMsg.hasName() ? refreshMsg.getName() : EmaString( "<not set>" ) ) << endl
		<< "Service Name: " << (refreshMsg.hasServiceName() ? refreshMsg.getServiceName() : EmaString( "<not set>" ) );

	cout << endl << "Item State: " << refreshMsg.getState().toString() << endl;

	decode(refreshMsg, refreshMsg.getComplete());
}
コード例 #8
0
void AppClient::onRefreshMsg( const RefreshMsg& refreshMsg, const OmmConsumerEvent& ommEvent ) 
{
	cout << endl << "Item Name: " << ( refreshMsg.hasName() ? refreshMsg.getName() : EmaString( "<not set>" ) ) << endl
		<< "Service Name: " << (refreshMsg.hasServiceName() ? refreshMsg.getServiceName() : EmaString( "<not set>" ) );

	cout << endl << "Item State: " << refreshMsg.getState().toString() << endl;

	cout << "Item Handle: " << ommEvent.getHandle() << endl << "Item Closure: " << ommEvent.getClosure() << endl;

	if ( DataType::FieldListEnum == refreshMsg.getPayload().getDataType() )
		decode( refreshMsg.getPayload().getFieldList() );
}
コード例 #9
0
ファイル: Consumer.cpp プロジェクト: HaroldWoods/Elektron-SDK
void AppClient::onRefreshMsg( const RefreshMsg& refreshMsg, const OmmConsumerEvent& ommEvent )
{
	cout << "Received Refresh. Item Handle: " << ommEvent.getHandle() << " Closure: " << ommEvent.getClosure() << endl;

	if ( refreshMsg.hasMsgKey() )
		cout << endl << "Item Name: " << refreshMsg.getName() << endl << "Service Name: " << refreshMsg.getServiceName();

	cout << endl << "Item State: " << refreshMsg.getState().toString() << endl;

	if ( DataType::FieldListEnum == refreshMsg.getPayload().getDataType() )
		decode( refreshMsg.getPayload().getFieldList() );

	// Reissue item's priority after receiving the first refresh message
	if ( refreshMsg.getState().getStreamState() == OmmState::OpenEnum &&
		refreshMsg.getState().getDataState() == OmmState::OkEnum &&
		!hasFirstRefresh )
	{
		_pOmmConsumer->reissue( ReqMsg().priority( 2, 2 ), ommEvent.getHandle() );
		hasFirstRefresh = true;
	}
}
コード例 #10
0
void AppLoginClient::onRefreshMsg(const RefreshMsg& refreshMsg, const OmmConsumerEvent& event)
{
	Login::LoginRefresh tempRefresh;
	cout << endl << "Received login refresh message" << endl;
	
	_handle = event.getHandle();
	cout << endl << refreshMsg << endl;

	tempRefresh.message(refreshMsg);
	if (tempRefresh.hasAuthenticationTTReissue())
		_TTReissue = tempRefresh.getAuthenticationTTReissue();
	else
		_TTReissue = 0;
}
コード例 #11
0
ファイル: Consumer.cpp プロジェクト: HaroldWoods/Elektron-SDK
void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& ommEvent )
{
	if ( updateMsg.hasMsgKey() )
		cout << endl << "Item Name: " << updateMsg.getName() << endl << "Service Name: " << updateMsg.getServiceName() << endl;

	if ( DataType::FieldListEnum == updateMsg.getPayload().getDataType() )
		decode( updateMsg.getPayload().getFieldList() );

	// Close streaming request after receiving 3 update messages
	if ( ++numOfUpdates == 3 )
	{
		cout << endl << "Close Item request" << endl;
		_pOmmConsumer->unregister( ommEvent.getHandle() );
	}
}
コード例 #12
0
ファイル: Consumer.cpp プロジェクト: HaroldWoods/Elektron-SDK
void AppClient::onRefreshMsg( const RefreshMsg& refreshMsg, const OmmConsumerEvent& ommEvent )
{
    cout << endl << "Received:    " << "RefreshMsg" << endl << "Handle: " << ommEvent.getHandle() << " Closure:     " << ommEvent.getClosure() << endl;

    if ( refreshMsg.hasMsgKey() )
        cout << "Item Name: " << refreshMsg.getName() << endl << "Service Name: " << ( refreshMsg.hasServiceName() ? refreshMsg.getServiceName() : EmaString( "not set" ) ) << endl;

    cout << "Item State: " << refreshMsg.getState().toString() << endl;

    if ( refreshMsg.getDomainType() == MMT_LOGIN &&
            refreshMsg.getState().getStreamState() == OmmState::OpenEnum &&
            refreshMsg.getState().getDataState() == OmmState::OkEnum )
    {
        _pOmmConsumer->submit( PostMsg().postId( 1 ).serviceId( 1501 ).name( "TRI.N" ).solicitAck( true ).complete().payload(
                                   RefreshMsg().payload( FieldList().addReal( 25, 35, OmmReal::ExponentPos1Enum ).complete() ).complete() ), ommEvent.getHandle() );
    }

    decode( refreshMsg );
}
コード例 #13
0
ファイル: Consumer.cpp プロジェクト: HaroldWoods/Elektron-SDK
void AppClient::onAckMsg( const AckMsg& ackMsg, const OmmConsumerEvent& event )
{
    cout << endl << "Received:    AckMsg" << endl << "Item Handle: " << event.getHandle() << endl << "Closure:     " << event.getClosure() << endl;

    decode( ackMsg );
}