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

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

namespace MFAPI {

CancelOrder::CancelOrder()
{
}

CancelOrder::~CancelOrder()
{
}

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

    orderID = in->read_int64();
    cxlID = in->read_string();
    feedID = in->read_int32();
    marketID = in->read_int32();
    clOrdID = in->read_string();
    timeApiClient = in->read_int64();
    timeApiServer = in->read_int64();
    timeHandler = in->read_int64();

}

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

    out->write_int64(orderID);
    out->write_string(cxlID);
    out->write_int32(feedID);
    out->write_int32(marketID);
    out->write_string(clOrdID);
    out->write_int64(timeApiClient);
    out->write_int64(timeApiServer);
    out->write_int64(timeHandler);

}

bool CancelOrder::operator!=(const CancelOrder& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(orderID != o.orderID) return true;
    if(cxlID != o.cxlID) return true;
    if(feedID != o.feedID) return true;
    if(marketID != o.marketID) return true;
    if(clOrdID != o.clOrdID) return true;
    if(timeApiClient != o.timeApiClient) return true;
    if(timeApiServer != o.timeApiServer) return true;
    if(timeHandler != o.timeHandler) return true;

    return false;
}

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

bool CancelOrder::operator<(const CancelOrder& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(orderID < o.orderID) return true;
    else if(o.orderID < orderID) return false;
    if(cxlID < o.cxlID) return true;
    else if(o.cxlID < cxlID) return false;
    if(feedID < o.feedID) return true;
    else if(o.feedID < feedID) return false;
    if(marketID < o.marketID) return true;
    else if(o.marketID < marketID) return false;
    if(clOrdID < o.clOrdID) return true;
    else if(o.clOrdID < clOrdID) return false;
    if(timeApiClient < o.timeApiClient) return true;
    else if(o.timeApiClient < timeApiClient) return false;
    if(timeApiServer < o.timeApiServer) return true;
    else if(o.timeApiServer < timeApiServer) return false;
    if(timeHandler < o.timeHandler) return true;
    else if(o.timeHandler < timeHandler) return false;

    return false;
}

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

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

void CancelOrder::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("orderID=");
    out->write_int64(this->orderID);
    wr->newfield();
    out->write_data("cxlID=");
    out->write_string(this->cxlID);
    wr->newfield();
    out->write_data("feedID=");
    out->write_int32(this->feedID);
    wr->newfield();
    out->write_data("marketID=");
    out->write_int32(this->marketID);
    wr->newfield();
    out->write_data("clOrdID=");
    out->write_string(this->clOrdID);
    wr->newfield();
    out->write_data("timeApiClient=");
    out->write_int64(this->timeApiClient);
    wr->newfield();
    out->write_data("timeApiServer=");
    out->write_int64(this->timeApiServer);
    wr->newfield();
    out->write_data("timeHandler=");
    out->write_int64(this->timeHandler);

    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 
*/
