// Copyright (C) 2010-2016  MarketFactory, Inc. All Rights Reserved.
//================================================================================
//   This file is auto-generated; DO NOT EDIT!
//================================================================================

#include <API/Clients/CPP/Proto/DropCopy.h>
#include <API/Clients/CPP/MFAPIClient/APIPrivate.h>

namespace MFAPI {

DropCopy::DropCopy()
{
}

DropCopy::~DropCopy()
{
}

void DropCopy::read(void* v)
{
    FastCodec* in = static_cast<FastCodec*>(v);
    (void)in;

    sequenceID = in->read_int32();
    customerClientID = in->read_string();
    customerAccountID = in->read_string();
    userName = in->read_string();
    onBehalfOfCompID = in->read_string();
    onBehalfOfSubID = in->read_string();
    clOrdID = in->read_string();
    exOrdID = in->read_string();
    exPendingID = in->read_string();
    exTradeID = in->read_string();
    modelID = in->read_string();
    timeExchange = in->read_int64();
    timeHandler = in->read_int64();
    timeApiServer = in->read_int64();
    timeApiClient = in->read_int64();
    feedID = in->read_int32();
    origFeedID = in->read_int32();
    marketID = in->read_int32();
    side = Side::Type(in->read_uint8());
    price = MFFloat(in->read_mffloat());
    origPrice = MFFloat(in->read_mffloat());
    baseCurrAmt = MFFloat(in->read_mffloat());
    baseCurrency = in->read_string();
    counterCurrAmt = MFFloat(in->read_mffloat());
    counterCurrency = in->read_string();
    settlCurrAmt = MFFloat(in->read_mffloat());
    settlCurrency = in->read_string();
    isTaker = in->read_bool();
    matchStatus = MatchStatus::Type(in->read_uint8());
    counterPartyID = in->read_string();
    tradeDate = in->read_int64();
    settlDate = in->read_int64();

}

void DropCopy::write(void* v) const
{
    FastCodec* out = static_cast<FastCodec*>(v);
    (void)out;

    out->write_int32(sequenceID);
    out->write_string(customerClientID);
    out->write_string(customerAccountID);
    out->write_string(userName);
    out->write_string(onBehalfOfCompID);
    out->write_string(onBehalfOfSubID);
    out->write_string(clOrdID);
    out->write_string(exOrdID);
    out->write_string(exPendingID);
    out->write_string(exTradeID);
    out->write_string(modelID);
    out->write_int64(timeExchange);
    out->write_int64(timeHandler);
    out->write_int64(timeApiServer);
    out->write_int64(timeApiClient);
    out->write_int32(feedID);
    out->write_int32(origFeedID);
    out->write_int32(marketID);
    out->write_uint8(side); /* enum Side */
    out->write_mffloat(price.toInt());
    out->write_mffloat(origPrice.toInt());
    out->write_mffloat(baseCurrAmt.toInt());
    out->write_string(baseCurrency);
    out->write_mffloat(counterCurrAmt.toInt());
    out->write_string(counterCurrency);
    out->write_mffloat(settlCurrAmt.toInt());
    out->write_string(settlCurrency);
    out->write_bool(isTaker);
    out->write_uint8(matchStatus); /* enum MatchStatus */
    out->write_string(counterPartyID);
    out->write_int64(tradeDate);
    out->write_int64(settlDate);

}

bool DropCopy::operator!=(const DropCopy& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(sequenceID != o.sequenceID) return true;
    if(customerClientID != o.customerClientID) return true;
    if(customerAccountID != o.customerAccountID) return true;
    if(userName != o.userName) return true;
    if(onBehalfOfCompID != o.onBehalfOfCompID) return true;
    if(onBehalfOfSubID != o.onBehalfOfSubID) return true;
    if(clOrdID != o.clOrdID) return true;
    if(exOrdID != o.exOrdID) return true;
    if(exPendingID != o.exPendingID) return true;
    if(exTradeID != o.exTradeID) return true;
    if(modelID != o.modelID) return true;
    if(timeExchange != o.timeExchange) return true;
    if(timeHandler != o.timeHandler) return true;
    if(timeApiServer != o.timeApiServer) return true;
    if(timeApiClient != o.timeApiClient) return true;
    if(feedID != o.feedID) return true;
    if(origFeedID != o.origFeedID) return true;
    if(marketID != o.marketID) return true;
    if(side != o.side) return true;
    if(price != o.price) return true;
    if(origPrice != o.origPrice) return true;
    if(baseCurrAmt != o.baseCurrAmt) return true;
    if(baseCurrency != o.baseCurrency) return true;
    if(counterCurrAmt != o.counterCurrAmt) return true;
    if(counterCurrency != o.counterCurrency) return true;
    if(settlCurrAmt != o.settlCurrAmt) return true;
    if(settlCurrency != o.settlCurrency) return true;
    if(isTaker != o.isTaker) return true;
    if(matchStatus != o.matchStatus) return true;
    if(counterPartyID != o.counterPartyID) return true;
    if(tradeDate != o.tradeDate) return true;
    if(settlDate != o.settlDate) return true;

    return false;
}

bool DropCopy::operator==(const DropCopy& o) const
{
    return !operator!=(o);
}

bool DropCopy::operator<(const DropCopy& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(sequenceID < o.sequenceID) return true;
    else if(o.sequenceID < sequenceID) return false;
    if(customerClientID < o.customerClientID) return true;
    else if(o.customerClientID < customerClientID) return false;
    if(customerAccountID < o.customerAccountID) return true;
    else if(o.customerAccountID < customerAccountID) return false;
    if(userName < o.userName) return true;
    else if(o.userName < userName) return false;
    if(onBehalfOfCompID < o.onBehalfOfCompID) return true;
    else if(o.onBehalfOfCompID < onBehalfOfCompID) return false;
    if(onBehalfOfSubID < o.onBehalfOfSubID) return true;
    else if(o.onBehalfOfSubID < onBehalfOfSubID) return false;
    if(clOrdID < o.clOrdID) return true;
    else if(o.clOrdID < clOrdID) return false;
    if(exOrdID < o.exOrdID) return true;
    else if(o.exOrdID < exOrdID) return false;
    if(exPendingID < o.exPendingID) return true;
    else if(o.exPendingID < exPendingID) return false;
    if(exTradeID < o.exTradeID) return true;
    else if(o.exTradeID < exTradeID) return false;
    if(modelID < o.modelID) return true;
    else if(o.modelID < modelID) return false;
    if(timeExchange < o.timeExchange) return true;
    else if(o.timeExchange < timeExchange) return false;
    if(timeHandler < o.timeHandler) return true;
    else if(o.timeHandler < timeHandler) return false;
    if(timeApiServer < o.timeApiServer) return true;
    else if(o.timeApiServer < timeApiServer) return false;
    if(timeApiClient < o.timeApiClient) return true;
    else if(o.timeApiClient < timeApiClient) return false;
    if(feedID < o.feedID) return true;
    else if(o.feedID < feedID) return false;
    if(origFeedID < o.origFeedID) return true;
    else if(o.origFeedID < origFeedID) return false;
    if(marketID < o.marketID) return true;
    else if(o.marketID < marketID) return false;
    if(side < o.side) return true;
    else if(o.side < side) return false;
    if(price < o.price) return true;
    else if(o.price < price) return false;
    if(origPrice < o.origPrice) return true;
    else if(o.origPrice < origPrice) return false;
    if(baseCurrAmt < o.baseCurrAmt) return true;
    else if(o.baseCurrAmt < baseCurrAmt) return false;
    if(baseCurrency < o.baseCurrency) return true;
    else if(o.baseCurrency < baseCurrency) return false;
    if(counterCurrAmt < o.counterCurrAmt) return true;
    else if(o.counterCurrAmt < counterCurrAmt) return false;
    if(counterCurrency < o.counterCurrency) return true;
    else if(o.counterCurrency < counterCurrency) return false;
    if(settlCurrAmt < o.settlCurrAmt) return true;
    else if(o.settlCurrAmt < settlCurrAmt) return false;
    if(settlCurrency < o.settlCurrency) return true;
    else if(o.settlCurrency < settlCurrency) return false;
    if(isTaker < o.isTaker) return true;
    else if(o.isTaker < isTaker) return false;
    if(matchStatus < o.matchStatus) return true;
    else if(o.matchStatus < matchStatus) return false;
    if(counterPartyID < o.counterPartyID) return true;
    else if(o.counterPartyID < counterPartyID) return false;
    if(tradeDate < o.tradeDate) return true;
    else if(o.tradeDate < tradeDate) return false;
    if(settlDate < o.settlDate) return true;
    else if(o.settlDate < settlDate) return false;

    return false;
}

std::ostream& operator<<(std::ostream& os, const DropCopy& o)
{
    o.dump(os, false);
    return os;
}

void DropCopy::dump(std::ostream& os, bool pretty) const
{
    TextStream sos;
    TextCodec codec(sos);
    TextWriter wr(codec, true);
    sos << "<DropCopy ";
    dump(&wr);
    sos << ">";
    os.write(sos.ends(), sos.size());
}

void DropCopy::dump(void* v) const
{
    TextWriter* wr = static_cast<TextWriter*>(v);
    TextCodec* out = &wr->out();
    (void)wr;

    TextWriter::State __state = wr->push("(", true);
    wr->newfield();
    out->write_data("sequenceID=");
    out->write_int32(this->sequenceID);
    wr->newfield();
    out->write_data("customerClientID=");
    out->write_string(this->customerClientID);
    wr->newfield();
    out->write_data("customerAccountID=");
    out->write_string(this->customerAccountID);
    wr->newfield();
    out->write_data("userName=");
    out->write_string(this->userName);
    wr->newfield();
    out->write_data("onBehalfOfCompID=");
    out->write_string(this->onBehalfOfCompID);
    wr->newfield();
    out->write_data("onBehalfOfSubID=");
    out->write_string(this->onBehalfOfSubID);
    wr->newfield();
    out->write_data("clOrdID=");
    out->write_string(this->clOrdID);
    wr->newfield();
    out->write_data("exOrdID=");
    out->write_string(this->exOrdID);
    wr->newfield();
    out->write_data("exPendingID=");
    out->write_string(this->exPendingID);
    wr->newfield();
    out->write_data("exTradeID=");
    out->write_string(this->exTradeID);
    wr->newfield();
    out->write_data("modelID=");
    out->write_string(this->modelID);
    wr->newfield();
    out->write_data("timeExchange=");
    out->write_int64(this->timeExchange);
    wr->newfield();
    out->write_data("timeHandler=");
    out->write_int64(this->timeHandler);
    wr->newfield();
    out->write_data("timeApiServer=");
    out->write_int64(this->timeApiServer);
    wr->newfield();
    out->write_data("timeApiClient=");
    out->write_int64(this->timeApiClient);
    wr->newfield();
    out->write_data("feedID=");
    out->write_int32(this->feedID);
    wr->newfield();
    out->write_data("origFeedID=");
    out->write_int32(this->origFeedID);
    wr->newfield();
    out->write_data("marketID=");
    out->write_int32(this->marketID);
    wr->newfield();
    out->write_data("side=");
    out->write_rawfield(Side::toString(this->side)); /* enum Side */
    wr->newfield();
    out->write_data("price=");
    out->write_int64(this->price.toInt());
    wr->newfield();
    out->write_data("origPrice=");
    out->write_int64(this->origPrice.toInt());
    wr->newfield();
    out->write_data("baseCurrAmt=");
    out->write_int64(this->baseCurrAmt.toInt());
    wr->newfield();
    out->write_data("baseCurrency=");
    out->write_string(this->baseCurrency);
    wr->newfield();
    out->write_data("counterCurrAmt=");
    out->write_int64(this->counterCurrAmt.toInt());
    wr->newfield();
    out->write_data("counterCurrency=");
    out->write_string(this->counterCurrency);
    wr->newfield();
    out->write_data("settlCurrAmt=");
    out->write_int64(this->settlCurrAmt.toInt());
    wr->newfield();
    out->write_data("settlCurrency=");
    out->write_string(this->settlCurrency);
    wr->newfield();
    out->write_data("isTaker=");
    out->write_bool(this->isTaker);
    wr->newfield();
    out->write_data("matchStatus=");
    out->write_rawfield(MatchStatus::toString(this->matchStatus)); /* enum MatchStatus */
    wr->newfield();
    out->write_data("counterPartyID=");
    out->write_string(this->counterPartyID);
    wr->newfield();
    out->write_data("tradeDate=");
    out->write_int64(this->tradeDate);
    wr->newfield();
    out->write_data("settlDate=");
    out->write_int64(this->settlDate);

    wr->pop(")", __state);
}

} // MFAPI

/*
Brought to you by
/opt/atlassian/bamboo-agent/xml-data/build-dir/GAT-GWY-B3/Messaging/main.py --root /opt/atlassian/bamboo-agent/xml-data/build-dir/GAT-GWY-B3 --commit-date 2016-12-06T18:11:31.205-05:00 --revision 19c07f7ab2ea0612a19fbcabdd4a54e242830e7d --branch master --generated_directory /opt/atlassian/bamboo-agent/xml-data/build-dir/GAT-GWY-B3/build/rh7_3.13.0/release/intel64/generated/Python -o /opt/atlassian/bamboo-agent/xml-data/build-dir/GAT-GWY-B3/build/rh7_3.13.0/release/intel64/generated/API/Clients/CPP/Proto -i /opt/atlassian/bamboo-agent/xml-data/build-dir/GAT-GWY-B3/Messaging/MFProtocol --namespace=MFAPI cppapi /opt/atlassian/bamboo-agent/xml-data/build-dir/GAT-GWY-B3/Messaging/MFProtocol.proto.3130 /opt/atlassian/bamboo-agent/xml-data/build-dir/GAT-GWY-B3/Messaging/MFObsolete.proto.3130 
*/
