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

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

namespace MFAPI {

ConfigMessage::ConfigMessage()
{
}

ConfigMessage::~ConfigMessage()
{
}

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

    {
        const uint16_t len = in->read_length();
        feedsList.resize(len);
        std::vector<APIFeed>::iterator it = feedsList.begin();
        for ( ; it != feedsList.end(); ++it ) {
            it->read(v);
        }
    }

}

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

    {
        out->write_length(feedsList.size());
        std::vector<APIFeed>::const_iterator it = feedsList.begin();
        for ( ; it != feedsList.end(); ++it ) {
            it->write(v);
        }
    }

}

bool ConfigMessage::operator!=(const ConfigMessage& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(feedsList != o.feedsList) return true;

    return false;
}

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

bool ConfigMessage::operator<(const ConfigMessage& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(feedsList < o.feedsList) return true;
    else if(o.feedsList < feedsList) return false;

    return false;
}

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

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

void ConfigMessage::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("feedsList=");

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

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