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

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

namespace MFAPI {

LastSequenceIDMessage::LastSequenceIDMessage()
{
}

LastSequenceIDMessage::~LastSequenceIDMessage()
{
}

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

    {
        const uint16_t len = in->read_length();
        feedSeqIDs.resize(len);
        std::vector<UserSequenceID>::iterator it = feedSeqIDs.begin();
        for ( ; it != feedSeqIDs.end(); ++it ) {
            it->read(v);
        }
    }
    feedID = in->read_int32();
    origFeedID = in->read_int32();
    sequenceID = in->read_int32();

}

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

    {
        out->write_length(feedSeqIDs.size());
        std::vector<UserSequenceID>::const_iterator it = feedSeqIDs.begin();
        for ( ; it != feedSeqIDs.end(); ++it ) {
            it->write(v);
        }
    }
    out->write_int32(feedID);
    out->write_int32(origFeedID);
    out->write_int32(sequenceID);

}

bool LastSequenceIDMessage::operator!=(const LastSequenceIDMessage& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(feedSeqIDs != o.feedSeqIDs) return true;
    if(feedID != o.feedID) return true;
    if(origFeedID != o.origFeedID) return true;
    if(sequenceID != o.sequenceID) return true;

    return false;
}

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

bool LastSequenceIDMessage::operator<(const LastSequenceIDMessage& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(feedSeqIDs < o.feedSeqIDs) return true;
    else if(o.feedSeqIDs < feedSeqIDs) 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(sequenceID < o.sequenceID) return true;
    else if(o.sequenceID < sequenceID) return false;

    return false;
}

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

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

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

    TextWriter::State __state = wr->push("(", false);
    wr->newfield();
    out->write_data("feedSeqIDs=");

    {
        TextWriter::State __state = wr->push("[", false);
        std::vector<UserSequenceID>::const_iterator it = this->feedSeqIDs.begin();
        std::vector<UserSequenceID>::const_iterator end__feedSeqIDs = this->feedSeqIDs.end();
        for ( ; it != end__feedSeqIDs; ++it ) {
            wr->newfield();
            it->dump(v);
        }
        wr->pop("]", __state);
    }

    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("sequenceID=");
    out->write_int32(this->sequenceID);

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