[PATCH] [MAMDA] Initialising Bid Price Field State


Gary Molloy <GMolloy@...>
 

From 1856d2fe95b4a5f9aa37acc2f6cfc95e8b64826c Mon Sep 17 00:00:00 2001

From: Gary Molloy <gmolloy@...>

Date: Thu, 13 Dec 2012 15:34:45 +0000

Subject: [PATCH] [MAMDA] Initialising Bid Price Field State

 

getBidPriceFieldState() will now return the correct value (MODIFIED) when a bid price of 0 is received

 

Signed-off-by: Gary Molloy <gmolloy@...>

---

mamda/c_cpp/src/cpp/MamdaQuoteListener.cpp         |    3 ++-

mamda/dotnet/src/cs/MamdaQuoteListener.cs          |    3 ++-

.../java/com/wombat/mamda/MamdaQuoteListener.java  |    3 ++-

3 files changed, 6 insertions(+), 3 deletions(-)

 

diff --git a/mamda/c_cpp/src/cpp/MamdaQuoteListener.cpp b/mamda/c_cpp/src/cpp/MamdaQuoteListener.cpp

index ea87ec5..25387eb 100644

--- a/mamda/c_cpp/src/cpp/MamdaQuoteListener.cpp

+++ b/mamda/c_cpp/src/cpp/MamdaQuoteListener.cpp

@@ -1671,7 +1671,8 @@ namespace Wombat

         {

             MamaPrice bidPrice;

             field.getPrice (bidPrice);

-            if (impl.mQuoteCache.mBidPrice != bidPrice)

+            if (impl.mQuoteCache.mBidPrice != bidPrice ||

+                impl.mQuoteCache.mBidPriceFieldState == NOT_INITIALISED)

             {

                 impl.mQuoteCache.mBidPrice = bidPrice;

                 impl.mQuoteCache.mGotBidPrice = true;

diff --git a/mamda/dotnet/src/cs/MamdaQuoteListener.cs b/mamda/dotnet/src/cs/MamdaQuoteListener.cs

index aae7c66..8d4facd 100644

--- a/mamda/dotnet/src/cs/MamdaQuoteListener.cs

+++ b/mamda/dotnet/src/cs/MamdaQuoteListener.cs

@@ -1092,7 +1092,8 @@ namespace Wombat

             {

                 MamaPrice bidPrice;

                 bidPrice = field.getPrice();

-                if (listener.mQuoteCache.mBidPrice.getValue() != bidPrice.getValue())

+                if (listener.mQuoteCache.mBidPrice.getValue() != bidPrice.getValue() ||

+                    listener.mQuoteCache.mBidPriceFieldState == MamdaFieldState.NOT_INITIALISED)

                 {

                     listener.mQuoteCache.mBidPrice.copy(bidPrice);

                     listener.mQuoteCache.mBidPriceFieldState = MamdaFieldState.MODIFIED;

diff --git a/mamda/java/com/wombat/mamda/MamdaQuoteListener.java b/mamda/java/com/wombat/mamda/MamdaQuoteListener.java

index acd85c4..3432434 100644

--- a/mamda/java/com/wombat/mamda/MamdaQuoteListener.java

+++ b/mamda/java/com/wombat/mamda/MamdaQuoteListener.java

@@ -1376,7 +1376,8 @@ public class MamdaQuoteListener implements MamdaMsgListener,

         {

             if (msg.tryPrice (null, MamdaQuoteFields.BID_PRICE.getFid(), listener.mQuoteCache.tmpPrice))

             {

-                if (listener.mQuoteCache.tmpPrice.getValue() != listener.mQuoteCache.mBidPrice.getValue())

+                if (listener.mQuoteCache.tmpPrice.getValue() != listener.mQuoteCache.mBidPrice.getValue() ||

+                    listener.mQuoteCache.mBidPriceFieldState.getState() == MamdaFieldState.NOT_INITIALISED)

                 {

                     listener.mQuoteCache.mBidPrice.setValue (listener.mQuoteCache.tmpPrice.getValue());

                     listener.mQuoteCache.mGotBidPrice = true;

--

1.7.9.5

 

 

 

gmolloy@...

Gary Molloy

Software Engineer

NYSE Technologies

NYSE Euronext

 

NYSE Euronext

Powering the Exchanging World

www.nyse.com/technologies

 

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.