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

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

namespace MFAPI {

VersionMessage::VersionMessage()
{
}

VersionMessage::~VersionMessage()
{
}

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

    program = in->read_string();
    version_major = in->read_int8();
    version_minor = in->read_int8();
    version_micro = in->read_int8();
    version_extra = in->read_string();
    revision = in->read_string();
    commitdate = in->read_string();
    branch = in->read_string();
    build = in->read_string();
    arch = in->read_string();
    host = in->read_string();
    date = in->read_string();
    time = in->read_string();
    compiler = in->read_string();
    defines = in->read_string();
    builduser = in->read_string();
    distribution = in->read_string();
    platform = in->read_string();
    protosig = in->read_string();
    syncSize = in->read_int32();
    extra1 = in->read_string();
    extra2 = in->read_string();
    extra3 = in->read_string();
    extra4 = in->read_string();
    extra5 = in->read_string();

}

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

    out->write_string(program);
    out->write_int8(version_major);
    out->write_int8(version_minor);
    out->write_int8(version_micro);
    out->write_string(version_extra);
    out->write_string(revision);
    out->write_string(commitdate);
    out->write_string(branch);
    out->write_string(build);
    out->write_string(arch);
    out->write_string(host);
    out->write_string(date);
    out->write_string(time);
    out->write_string(compiler);
    out->write_string(defines);
    out->write_string(builduser);
    out->write_string(distribution);
    out->write_string(platform);
    out->write_string(protosig);
    out->write_int32(syncSize);
    out->write_string(extra1);
    out->write_string(extra2);
    out->write_string(extra3);
    out->write_string(extra4);
    out->write_string(extra5);

}

bool VersionMessage::operator!=(const VersionMessage& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(program != o.program) return true;
    if(version_major != o.version_major) return true;
    if(version_minor != o.version_minor) return true;
    if(version_micro != o.version_micro) return true;
    if(version_extra != o.version_extra) return true;
    if(revision != o.revision) return true;
    if(commitdate != o.commitdate) return true;
    if(branch != o.branch) return true;
    if(build != o.build) return true;
    if(arch != o.arch) return true;
    if(host != o.host) return true;
    if(date != o.date) return true;
    if(time != o.time) return true;
    if(compiler != o.compiler) return true;
    if(defines != o.defines) return true;
    if(builduser != o.builduser) return true;
    if(distribution != o.distribution) return true;
    if(platform != o.platform) return true;
    if(protosig != o.protosig) return true;
    if(syncSize != o.syncSize) return true;
    if(extra1 != o.extra1) return true;
    if(extra2 != o.extra2) return true;
    if(extra3 != o.extra3) return true;
    if(extra4 != o.extra4) return true;
    if(extra5 != o.extra5) return true;

    return false;
}

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

bool VersionMessage::operator<(const VersionMessage& o) const
{
    if(this == &o)
    {
        return false;
    }
    if(program < o.program) return true;
    else if(o.program < program) return false;
    if(version_major < o.version_major) return true;
    else if(o.version_major < version_major) return false;
    if(version_minor < o.version_minor) return true;
    else if(o.version_minor < version_minor) return false;
    if(version_micro < o.version_micro) return true;
    else if(o.version_micro < version_micro) return false;
    if(version_extra < o.version_extra) return true;
    else if(o.version_extra < version_extra) return false;
    if(revision < o.revision) return true;
    else if(o.revision < revision) return false;
    if(commitdate < o.commitdate) return true;
    else if(o.commitdate < commitdate) return false;
    if(branch < o.branch) return true;
    else if(o.branch < branch) return false;
    if(build < o.build) return true;
    else if(o.build < build) return false;
    if(arch < o.arch) return true;
    else if(o.arch < arch) return false;
    if(host < o.host) return true;
    else if(o.host < host) return false;
    if(date < o.date) return true;
    else if(o.date < date) return false;
    if(time < o.time) return true;
    else if(o.time < time) return false;
    if(compiler < o.compiler) return true;
    else if(o.compiler < compiler) return false;
    if(defines < o.defines) return true;
    else if(o.defines < defines) return false;
    if(builduser < o.builduser) return true;
    else if(o.builduser < builduser) return false;
    if(distribution < o.distribution) return true;
    else if(o.distribution < distribution) return false;
    if(platform < o.platform) return true;
    else if(o.platform < platform) return false;
    if(protosig < o.protosig) return true;
    else if(o.protosig < protosig) return false;
    if(syncSize < o.syncSize) return true;
    else if(o.syncSize < syncSize) return false;
    if(extra1 < o.extra1) return true;
    else if(o.extra1 < extra1) return false;
    if(extra2 < o.extra2) return true;
    else if(o.extra2 < extra2) return false;
    if(extra3 < o.extra3) return true;
    else if(o.extra3 < extra3) return false;
    if(extra4 < o.extra4) return true;
    else if(o.extra4 < extra4) return false;
    if(extra5 < o.extra5) return true;
    else if(o.extra5 < extra5) return false;

    return false;
}

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

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

void VersionMessage::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("program=");
    out->write_string(this->program);
    wr->newfield();
    out->write_data("version_major=");
    out->write_int8(this->version_major);
    wr->newfield();
    out->write_data("version_minor=");
    out->write_int8(this->version_minor);
    wr->newfield();
    out->write_data("version_micro=");
    out->write_int8(this->version_micro);
    wr->newfield();
    out->write_data("version_extra=");
    out->write_string(this->version_extra);
    wr->newfield();
    out->write_data("revision=");
    out->write_string(this->revision);
    wr->newfield();
    out->write_data("commitdate=");
    out->write_string(this->commitdate);
    wr->newfield();
    out->write_data("branch=");
    out->write_string(this->branch);
    wr->newfield();
    out->write_data("build=");
    out->write_string(this->build);
    wr->newfield();
    out->write_data("arch=");
    out->write_string(this->arch);
    wr->newfield();
    out->write_data("host=");
    out->write_string(this->host);
    wr->newfield();
    out->write_data("date=");
    out->write_string(this->date);
    wr->newfield();
    out->write_data("time=");
    out->write_string(this->time);
    wr->newfield();
    out->write_data("compiler=");
    out->write_string(this->compiler);
    wr->newfield();
    out->write_data("defines=");
    out->write_string(this->defines);
    wr->newfield();
    out->write_data("builduser=");
    out->write_string(this->builduser);
    wr->newfield();
    out->write_data("distribution=");
    out->write_string(this->distribution);
    wr->newfield();
    out->write_data("platform=");
    out->write_string(this->platform);
    wr->newfield();
    out->write_data("protosig=");
    out->write_string(this->protosig);
    wr->newfield();
    out->write_data("syncSize=");
    out->write_int32(this->syncSize);
    wr->newfield();
    out->write_data("extra1=");
    out->write_string(this->extra1);
    wr->newfield();
    out->write_data("extra2=");
    out->write_string(this->extra2);
    wr->newfield();
    out->write_data("extra3=");
    out->write_string(this->extra3);
    wr->newfield();
    out->write_data("extra4=");
    out->write_string(this->extra4);
    wr->newfield();
    out->write_data("extra5=");
    out->write_string(this->extra5);

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