Blank DataBuffer

mktdata
mktdata Contributor

Hello we are using RFA 8.1 C++ api to consume market data.

Can you tell me the effect of following call if Data buffer is blank i.e. DataBuffer::isBlank() == true;

double price = dataBuffer.getDouble();

int size = static_cast<int>(dataBuffer.getReal().getValue());


What would be value of "price" and "size" in this case? Is it a valid code?



Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @mktdata

    Thanks for reaching out to us.

    The application must not access the value in the DataBuffer when the DataBuffer is blank because it can cause unexpected behaviors, such as getting invalid values.

    In conclusion, the application must check isBlank() before accessing its value. If the data is blank, the application must not call the get method to retrieve the data.

    I hope that this information is of help.