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

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

namespace MFAPI {

TradeLimit::TradeLimit()
{
}

TradeLimit::~TradeLimit()
{
}

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

    limitID = in->read_string();
    groupName = in->read_string();
    feedID = in->read_int32();
    marketID = in->read_int32();
    ccyType = CcyType::Type(in->read_uint8());
    nopAmount = in->read_string();
    dslAmount = in->read_string();
    positionAmount = in->read_string();
    pendingAmount = in->read_string();
    singleAmount = in->read_string();
    throttleCap = in->read_string();
    adminName = in->read_string();
    contacts = in->read_string();
    nopWarnPct = in->read_int16();
    dslWarnPct = in->read_int16();

}

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

    out->write_string(limitID);
    out->write_string(groupName);
    out->write_int32(feedID);
    out->write_int32(marketID);
    out->write_uint8(ccyType); /* enum CcyType */
    out->write_string(nopAmount);
    out->write_string(dslAmount);
    out->write_string(positionAmount);
    out->write_string(pendingAmount);
    out->write_string(singleAmount);
    out->write_string(throttleCap);
    out->write_string(adminName);
    out->write_string(contacts);
    out->write_int16(nopWarnPct);
    out->write_int16(dslWarnPct);

}

bool TradeLimit::operator!=(const TradeLimit& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(limitID != o.limitID) return true;
    if(groupName != o.groupName) return true;
    if(feedID != o.feedID) return true;
    if(marketID != o.marketID) return true;
    if(ccyType != o.ccyType) return true;
    if(nopAmount != o.nopAmount) return true;
    if(dslAmount != o.dslAmount) return true;
    if(positionAmount != o.positionAmount) return true;
    if(pendingAmount != o.pendingAmount) return true;
    if(singleAmount != o.singleAmount) return true;
    if(throttleCap != o.throttleCap) return true;
    if(adminName != o.adminName) return true;
    if(contacts != o.contacts) return true;
    if(nopWarnPct != o.nopWarnPct) return true;
    if(dslWarnPct != o.dslWarnPct) return true;

    return false;
}

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

bool TradeLimit::operator<(const TradeLimit& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(limitID < o.limitID) return true;
    else if(o.limitID < limitID) return false;
    if(groupName < o.groupName) return true;
    else if(o.groupName < groupName) 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(ccyType < o.ccyType) return true;
    else if(o.ccyType < ccyType) return false;
    if(nopAmount < o.nopAmount) return true;
    else if(o.nopAmount < nopAmount) return false;
    if(dslAmount < o.dslAmount) return true;
    else if(o.dslAmount < dslAmount) return false;
    if(positionAmount < o.positionAmount) return true;
    else if(o.positionAmount < positionAmount) return false;
    if(pendingAmount < o.pendingAmount) return true;
    else if(o.pendingAmount < pendingAmount) return false;
    if(singleAmount < o.singleAmount) return true;
    else if(o.singleAmount < singleAmount) return false;
    if(throttleCap < o.throttleCap) return true;
    else if(o.throttleCap < throttleCap) return false;
    if(adminName < o.adminName) return true;
    else if(o.adminName < adminName) return false;
    if(contacts < o.contacts) return true;
    else if(o.contacts < contacts) return false;
    if(nopWarnPct < o.nopWarnPct) return true;
    else if(o.nopWarnPct < nopWarnPct) return false;
    if(dslWarnPct < o.dslWarnPct) return true;
    else if(o.dslWarnPct < dslWarnPct) return false;

    return false;
}

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

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

void TradeLimit::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("limitID=");
    out->write_string(this->limitID);
    wr->newfield();
    out->write_data("groupName=");
    out->write_string(this->groupName);
    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("ccyType=");
    out->write_rawfield(CcyType::toString(this->ccyType)); /* enum CcyType */
    wr->newfield();
    out->write_data("nopAmount=");
    out->write_string(this->nopAmount);
    wr->newfield();
    out->write_data("dslAmount=");
    out->write_string(this->dslAmount);
    wr->newfield();
    out->write_data("positionAmount=");
    out->write_string(this->positionAmount);
    wr->newfield();
    out->write_data("pendingAmount=");
    out->write_string(this->pendingAmount);
    wr->newfield();
    out->write_data("singleAmount=");
    out->write_string(this->singleAmount);
    wr->newfield();
    out->write_data("throttleCap=");
    out->write_string(this->throttleCap);
    wr->newfield();
    out->write_data("adminName=");
    out->write_string(this->adminName);
    wr->newfield();
    out->write_data("contacts=");
    out->write_string(this->contacts);
    wr->newfield();
    out->write_data("nopWarnPct=");
    out->write_int16(this->nopWarnPct);
    wr->newfield();
    out->write_data("dslWarnPct=");
    out->write_int16(this->dslWarnPct);

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