//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
//
// Ice version 3.7.10
//
// <auto-generated>
//
// Generated from file `Election.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//

#include <IceStorm/Election.h>
#include <IceUtil/PushDisableWarnings.h>
#include <Ice/LocalException.h>
#include <Ice/ValueFactory.h>
#include <Ice/OutgoingAsync.h>
#include <Ice/InputStream.h>
#include <Ice/OutputStream.h>
#include <Ice/LocalException.h>
#include <IceUtil/PopDisableWarnings.h>

#if defined(_MSC_VER)
#   pragma warning(disable:4458) // declaration of ... hides class member
#elif defined(__clang__)
#   pragma clang diagnostic ignored "-Wshadow"
#elif defined(__GNUC__)
#   pragma GCC diagnostic ignored "-Wshadow"
#endif

#ifndef ICE_IGNORE_VERSION
#   if ICE_INT_VERSION / 100 != 307
#       error Ice version mismatch!
#   endif
#   if ICE_INT_VERSION % 100 >= 50
#       error Beta header file detected
#   endif
#   if ICE_INT_VERSION % 100 < 10
#       error Ice patch level mismatch!
#   endif
#endif

#ifdef ICE_CPP11_MAPPING // C++11 mapping

namespace
{

const ::IceInternal::DefaultUserExceptionFactoryInit<::IceStormElection::ObserverInconsistencyException> iceC_IceStormElection_ObserverInconsistencyException_init("::IceStormElection::ObserverInconsistencyException");

const ::std::string iceC_IceStormElection_ReplicaObserver_ids[2] =
{
    "::Ice::Object",
    "::IceStormElection::ReplicaObserver"
};
const ::std::string iceC_IceStormElection_ReplicaObserver_ops[] =
{
    "addSubscriber",
    "createTopic",
    "destroyTopic",
    "ice_id",
    "ice_ids",
    "ice_isA",
    "ice_ping",
    "init",
    "removeSubscriber"
};
const ::std::string iceC_IceStormElection_ReplicaObserver_init_name = "init";
const ::std::string iceC_IceStormElection_ReplicaObserver_createTopic_name = "createTopic";
const ::std::string iceC_IceStormElection_ReplicaObserver_destroyTopic_name = "destroyTopic";
const ::std::string iceC_IceStormElection_ReplicaObserver_addSubscriber_name = "addSubscriber";
const ::std::string iceC_IceStormElection_ReplicaObserver_removeSubscriber_name = "removeSubscriber";

const ::std::string iceC_IceStormElection_TopicManagerSync_ids[2] =
{
    "::Ice::Object",
    "::IceStormElection::TopicManagerSync"
};
const ::std::string iceC_IceStormElection_TopicManagerSync_ops[] =
{
    "getContent",
    "ice_id",
    "ice_ids",
    "ice_isA",
    "ice_ping"
};
const ::std::string iceC_IceStormElection_TopicManagerSync_getContent_name = "getContent";

const ::std::string iceC_IceStormElection_Node_ids[2] =
{
    "::Ice::Object",
    "::IceStormElection::Node"
};
const ::std::string iceC_IceStormElection_Node_ops[] =
{
    "accept",
    "areYouCoordinator",
    "areYouThere",
    "ice_id",
    "ice_ids",
    "ice_isA",
    "ice_ping",
    "invitation",
    "nodes",
    "query",
    "ready",
    "sync"
};
const ::std::string iceC_IceStormElection_Node_invitation_name = "invitation";
const ::std::string iceC_IceStormElection_Node_ready_name = "ready";
const ::std::string iceC_IceStormElection_Node_accept_name = "accept";
const ::std::string iceC_IceStormElection_Node_areYouCoordinator_name = "areYouCoordinator";
const ::std::string iceC_IceStormElection_Node_areYouThere_name = "areYouThere";
const ::std::string iceC_IceStormElection_Node_sync_name = "sync";
const ::std::string iceC_IceStormElection_Node_nodes_name = "nodes";
const ::std::string iceC_IceStormElection_Node_query_name = "query";

}

IceStormElection::ObserverInconsistencyException::~ObserverInconsistencyException()
{
}

const ::std::string&
IceStormElection::ObserverInconsistencyException::ice_staticId()
{
    static const ::std::string typeId = "::IceStormElection::ObserverInconsistencyException";
    return typeId;
}

bool
IceStormElection::ReplicaObserver::ice_isA(::std::string s, const ::Ice::Current&) const
{
    return ::std::binary_search(iceC_IceStormElection_ReplicaObserver_ids, iceC_IceStormElection_ReplicaObserver_ids + 2, s);
}

::std::vector<::std::string>
IceStormElection::ReplicaObserver::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector<::std::string>(&iceC_IceStormElection_ReplicaObserver_ids[0], &iceC_IceStormElection_ReplicaObserver_ids[2]);
}

::std::string
IceStormElection::ReplicaObserver::ice_id(const ::Ice::Current&) const
{
    return ice_staticId();
}

const ::std::string&
IceStormElection::ReplicaObserver::ice_staticId()
{
    static const ::std::string typeId = "::IceStormElection::ReplicaObserver";
    return typeId;
}

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_init(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    LogUpdate iceP_llu;
    TopicContentSeq iceP_content;
    istr->readAll(iceP_llu, iceP_content);
    inS.endReadParams();
    this->init(::std::move(iceP_llu), ::std::move(iceP_content), current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_createTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_name;
    istr->readAll(iceP_llu, iceP_name);
    inS.endReadParams();
    this->createTopic(::std::move(iceP_llu), ::std::move(iceP_name), current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_destroyTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_name;
    istr->readAll(iceP_llu, iceP_name);
    inS.endReadParams();
    this->destroyTopic(::std::move(iceP_llu), ::std::move(iceP_name), current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_addSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_topic;
    ::IceStorm::SubscriberRecord iceP_record;
    istr->readAll(iceP_llu, iceP_topic, iceP_record);
    inS.endReadParams();
    this->addSubscriber(::std::move(iceP_llu), ::std::move(iceP_topic), ::std::move(iceP_record), current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_removeSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_topic;
    ::Ice::IdentitySeq iceP_subscribers;
    istr->readAll(iceP_llu, iceP_topic, iceP_subscribers);
    inS.endReadParams();
    this->removeSubscriber(::std::move(iceP_llu), ::std::move(iceP_topic), ::std::move(iceP_subscribers), current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
{
    ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_ReplicaObserver_ops, iceC_IceStormElection_ReplicaObserver_ops + 9, current.operation);
    if(r.first == r.second)
    {
        throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
    }

    switch(r.first - iceC_IceStormElection_ReplicaObserver_ops)
    {
        case 0:
        {
            return _iceD_addSubscriber(in, current);
        }
        case 1:
        {
            return _iceD_createTopic(in, current);
        }
        case 2:
        {
            return _iceD_destroyTopic(in, current);
        }
        case 3:
        {
            return _iceD_ice_id(in, current);
        }
        case 4:
        {
            return _iceD_ice_ids(in, current);
        }
        case 5:
        {
            return _iceD_ice_isA(in, current);
        }
        case 6:
        {
            return _iceD_ice_ping(in, current);
        }
        case 7:
        {
            return _iceD_init(in, current);
        }
        case 8:
        {
            return _iceD_removeSubscriber(in, current);
        }
        default:
        {
            assert(false);
            throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
        }
    }
}
/// \endcond

bool
IceStormElection::TopicManagerSync::ice_isA(::std::string s, const ::Ice::Current&) const
{
    return ::std::binary_search(iceC_IceStormElection_TopicManagerSync_ids, iceC_IceStormElection_TopicManagerSync_ids + 2, s);
}

::std::vector<::std::string>
IceStormElection::TopicManagerSync::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector<::std::string>(&iceC_IceStormElection_TopicManagerSync_ids[0], &iceC_IceStormElection_TopicManagerSync_ids[2]);
}

::std::string
IceStormElection::TopicManagerSync::ice_id(const ::Ice::Current&) const
{
    return ice_staticId();
}

const ::std::string&
IceStormElection::TopicManagerSync::ice_staticId()
{
    static const ::std::string typeId = "::IceStormElection::TopicManagerSync";
    return typeId;
}

/// \cond INTERNAL
bool
IceStormElection::TopicManagerSync::_iceD_getContent(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    inS.readEmptyParams();
    LogUpdate iceP_llu;
    TopicContentSeq iceP_content;
    this->getContent(iceP_llu, iceP_content, current);
    auto ostr = inS.startWriteParams();
    ostr->writeAll(iceP_llu, iceP_content);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::TopicManagerSync::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
{
    ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_TopicManagerSync_ops, iceC_IceStormElection_TopicManagerSync_ops + 5, current.operation);
    if(r.first == r.second)
    {
        throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
    }

    switch(r.first - iceC_IceStormElection_TopicManagerSync_ops)
    {
        case 0:
        {
            return _iceD_getContent(in, current);
        }
        case 1:
        {
            return _iceD_ice_id(in, current);
        }
        case 2:
        {
            return _iceD_ice_ids(in, current);
        }
        case 3:
        {
            return _iceD_ice_isA(in, current);
        }
        case 4:
        {
            return _iceD_ice_ping(in, current);
        }
        default:
        {
            assert(false);
            throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
        }
    }
}
/// \endcond

bool
IceStormElection::Node::ice_isA(::std::string s, const ::Ice::Current&) const
{
    return ::std::binary_search(iceC_IceStormElection_Node_ids, iceC_IceStormElection_Node_ids + 2, s);
}

::std::vector<::std::string>
IceStormElection::Node::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector<::std::string>(&iceC_IceStormElection_Node_ids[0], &iceC_IceStormElection_Node_ids[2]);
}

::std::string
IceStormElection::Node::ice_id(const ::Ice::Current&) const
{
    return ice_staticId();
}

const ::std::string&
IceStormElection::Node::ice_staticId()
{
    static const ::std::string typeId = "::IceStormElection::Node";
    return typeId;
}

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_invitation(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    int iceP_j;
    ::std::string iceP_gn;
    istr->readAll(iceP_j, iceP_gn);
    inS.endReadParams();
    this->invitation(iceP_j, ::std::move(iceP_gn), current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_ready(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    int iceP_j;
    ::std::string iceP_gn;
    ::std::shared_ptr<::Ice::ObjectPrx> iceP_coordinator;
    int iceP_max;
    long long int iceP_generation;
    istr->readAll(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation);
    inS.endReadParams();
    this->ready(iceP_j, ::std::move(iceP_gn), ::std::move(iceP_coordinator), iceP_max, iceP_generation, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_accept(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
    auto istr = inS.startReadParams();
    int iceP_j;
    ::std::string iceP_gn;
    ::Ice::IntSeq iceP_forwardedInvites;
    ::std::shared_ptr<::Ice::ObjectPrx> iceP_observer;
    LogUpdate iceP_llu;
    int iceP_max;
    istr->readAll(iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max);
    inS.endReadParams();
    this->accept(iceP_j, ::std::move(iceP_gn), ::std::move(iceP_forwardedInvites), ::std::move(iceP_observer), ::std::move(iceP_llu), iceP_max, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_areYouCoordinator(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
    inS.readEmptyParams();
    bool ret = this->areYouCoordinator(current);
    auto ostr = inS.startWriteParams();
    ostr->writeAll(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_areYouThere(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
    auto istr = inS.startReadParams();
    ::std::string iceP_gn;
    int iceP_j;
    istr->readAll(iceP_gn, iceP_j);
    inS.endReadParams();
    bool ret = this->areYouThere(::std::move(iceP_gn), iceP_j, current);
    auto ostr = inS.startWriteParams();
    ostr->writeAll(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_sync(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
    inS.readEmptyParams();
    ::std::shared_ptr<::Ice::ObjectPrx> ret = this->sync(current);
    auto ostr = inS.startWriteParams();
    ostr->writeAll(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_nodes(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
    inS.readEmptyParams();
    NodeInfoSeq ret = this->nodes(current);
    auto ostr = inS.startWriteParams();
    ostr->writeAll(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_query(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
    inS.readEmptyParams();
    QueryInfo ret = this->query(current);
    auto ostr = inS.startWriteParams();
    ostr->writeAll(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
{
    ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_Node_ops, iceC_IceStormElection_Node_ops + 12, current.operation);
    if(r.first == r.second)
    {
        throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
    }

    switch(r.first - iceC_IceStormElection_Node_ops)
    {
        case 0:
        {
            return _iceD_accept(in, current);
        }
        case 1:
        {
            return _iceD_areYouCoordinator(in, current);
        }
        case 2:
        {
            return _iceD_areYouThere(in, current);
        }
        case 3:
        {
            return _iceD_ice_id(in, current);
        }
        case 4:
        {
            return _iceD_ice_ids(in, current);
        }
        case 5:
        {
            return _iceD_ice_isA(in, current);
        }
        case 6:
        {
            return _iceD_ice_ping(in, current);
        }
        case 7:
        {
            return _iceD_invitation(in, current);
        }
        case 8:
        {
            return _iceD_nodes(in, current);
        }
        case 9:
        {
            return _iceD_query(in, current);
        }
        case 10:
        {
            return _iceD_ready(in, current);
        }
        case 11:
        {
            return _iceD_sync(in, current);
        }
        default:
        {
            assert(false);
            throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
        }
    }
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::ReplicaObserverPrx::_iceI_init(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const LogUpdate& iceP_llu, const TopicContentSeq& iceP_content, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_init_name);
    outAsync->invoke(iceC_IceStormElection_ReplicaObserver_init_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_llu, iceP_content);
        },
        [](const ::Ice::UserException& ex)
        {
            try
            {
                ex.ice_throw();
            }
            catch(const ObserverInconsistencyException&)
            {
                throw;
            }
            catch(const ::Ice::UserException&)
            {
            }
        });
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::ReplicaObserverPrx::_iceI_createTopic(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_createTopic_name);
    outAsync->invoke(iceC_IceStormElection_ReplicaObserver_createTopic_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_llu, iceP_name);
        },
        [](const ::Ice::UserException& ex)
        {
            try
            {
                ex.ice_throw();
            }
            catch(const ObserverInconsistencyException&)
            {
                throw;
            }
            catch(const ::Ice::UserException&)
            {
            }
        });
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::ReplicaObserverPrx::_iceI_destroyTopic(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
    outAsync->invoke(iceC_IceStormElection_ReplicaObserver_destroyTopic_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_llu, iceP_name);
        },
        [](const ::Ice::UserException& ex)
        {
            try
            {
                ex.ice_throw();
            }
            catch(const ObserverInconsistencyException&)
            {
                throw;
            }
            catch(const ::Ice::UserException&)
            {
            }
        });
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::ReplicaObserverPrx::_iceI_addSubscriber(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::IceStorm::SubscriberRecord& iceP_record, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
    outAsync->invoke(iceC_IceStormElection_ReplicaObserver_addSubscriber_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_llu, iceP_topic, iceP_record);
        },
        [](const ::Ice::UserException& ex)
        {
            try
            {
                ex.ice_throw();
            }
            catch(const ObserverInconsistencyException&)
            {
                throw;
            }
            catch(const ::Ice::UserException&)
            {
            }
        });
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::ReplicaObserverPrx::_iceI_removeSubscriber(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, const LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::Ice::IdentitySeq& iceP_subscribers, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
    outAsync->invoke(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_llu, iceP_topic, iceP_subscribers);
        },
        [](const ::Ice::UserException& ex)
        {
            try
            {
                ex.ice_throw();
            }
            catch(const ObserverInconsistencyException&)
            {
                throw;
            }
            catch(const ::Ice::UserException&)
            {
            }
        });
}
/// \endcond

/// \cond INTERNAL
::std::shared_ptr<::Ice::ObjectPrx>
IceStormElection::ReplicaObserverPrx::_newInstance() const
{
    return ::IceInternal::createProxy<ReplicaObserverPrx>();
}
/// \endcond

const ::std::string&
IceStormElection::ReplicaObserverPrx::ice_staticId()
{
    return ReplicaObserver::ice_staticId();
}

/// \cond INTERNAL
void
IceStormElection::TopicManagerSyncPrx::_iceI_getContent(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<TopicManagerSync::GetContentResult>>& outAsync, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_TopicManagerSync_getContent_name);
    outAsync->invoke(iceC_IceStormElection_TopicManagerSync_getContent_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        nullptr,
        nullptr,
        [](::Ice::InputStream* istr)
        {
            TopicManagerSync::GetContentResult v;
            istr->readAll(v.llu, v.content);
            return v;
        });
}
/// \endcond

/// \cond INTERNAL
::std::shared_ptr<::Ice::ObjectPrx>
IceStormElection::TopicManagerSyncPrx::_newInstance() const
{
    return ::IceInternal::createProxy<TopicManagerSyncPrx>();
}
/// \endcond

const ::std::string&
IceStormElection::TopicManagerSyncPrx::ice_staticId()
{
    return TopicManagerSync::ice_staticId();
}

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_invitation(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, int iceP_j, const ::std::string& iceP_gn, const ::Ice::Context& context)
{
    outAsync->invoke(iceC_IceStormElection_Node_invitation_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_j, iceP_gn);
        },
        nullptr);
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_ready(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, int iceP_j, const ::std::string& iceP_gn, const ::std::shared_ptr<::Ice::ObjectPrx>& iceP_coordinator, int iceP_max, long long int iceP_generation, const ::Ice::Context& context)
{
    outAsync->invoke(iceC_IceStormElection_Node_ready_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation);
        },
        nullptr);
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_accept(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync, int iceP_j, const ::std::string& iceP_gn, const ::Ice::IntSeq& iceP_forwardedInvites, const ::std::shared_ptr<::Ice::ObjectPrx>& iceP_observer, const LogUpdate& iceP_llu, int iceP_max, const ::Ice::Context& context)
{
    outAsync->invoke(iceC_IceStormElection_Node_accept_name, ::Ice::OperationMode::Normal, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max);
        },
        nullptr);
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_areYouCoordinator(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<bool>>& outAsync, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_areYouCoordinator_name);
    outAsync->invoke(iceC_IceStormElection_Node_areYouCoordinator_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
        nullptr,
        nullptr);
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_areYouThere(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<bool>>& outAsync, const ::std::string& iceP_gn, int iceP_j, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_areYouThere_name);
    outAsync->invoke(iceC_IceStormElection_Node_areYouThere_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
        [&](::Ice::OutputStream* ostr)
        {
            ostr->writeAll(iceP_gn, iceP_j);
        },
        nullptr);
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_sync(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::std::shared_ptr<::Ice::ObjectPrx>>>& outAsync, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_sync_name);
    outAsync->invoke(iceC_IceStormElection_Node_sync_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
        nullptr,
        nullptr);
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_nodes(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceStormElection::NodeInfoSeq>>& outAsync, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_nodes_name);
    outAsync->invoke(iceC_IceStormElection_Node_nodes_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
        nullptr,
        nullptr);
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::NodePrx::_iceI_query(const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceStormElection::QueryInfo>>& outAsync, const ::Ice::Context& context)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_query_name);
    outAsync->invoke(iceC_IceStormElection_Node_query_name, ::Ice::OperationMode::Idempotent, ::Ice::FormatType::DefaultFormat, context,
        nullptr,
        nullptr);
}
/// \endcond

/// \cond INTERNAL
::std::shared_ptr<::Ice::ObjectPrx>
IceStormElection::NodePrx::_newInstance() const
{
    return ::IceInternal::createProxy<NodePrx>();
}
/// \endcond

const ::std::string&
IceStormElection::NodePrx::ice_staticId()
{
    return Node::ice_staticId();
}

namespace Ice
{
}

#else // C++98 mapping

namespace
{

const ::std::string iceC_IceStormElection_ReplicaObserver_init_name = "init";

const ::std::string iceC_IceStormElection_ReplicaObserver_createTopic_name = "createTopic";

const ::std::string iceC_IceStormElection_ReplicaObserver_destroyTopic_name = "destroyTopic";

const ::std::string iceC_IceStormElection_ReplicaObserver_addSubscriber_name = "addSubscriber";

const ::std::string iceC_IceStormElection_ReplicaObserver_removeSubscriber_name = "removeSubscriber";

const ::std::string iceC_IceStormElection_TopicManagerSync_getContent_name = "getContent";

const ::std::string iceC_IceStormElection_Node_invitation_name = "invitation";

const ::std::string iceC_IceStormElection_Node_ready_name = "ready";

const ::std::string iceC_IceStormElection_Node_accept_name = "accept";

const ::std::string iceC_IceStormElection_Node_areYouCoordinator_name = "areYouCoordinator";

const ::std::string iceC_IceStormElection_Node_areYouThere_name = "areYouThere";

const ::std::string iceC_IceStormElection_Node_sync_name = "sync";

const ::std::string iceC_IceStormElection_Node_nodes_name = "nodes";

const ::std::string iceC_IceStormElection_Node_query_name = "query";

}

namespace
{

const ::IceInternal::DefaultUserExceptionFactoryInit< ::IceStormElection::ObserverInconsistencyException> iceC_IceStormElection_ObserverInconsistencyException_init("::IceStormElection::ObserverInconsistencyException");

}

IceStormElection::ObserverInconsistencyException::ObserverInconsistencyException(const ::std::string& reason) :
    ::Ice::UserException(),
    reason(reason)
{
}

#ifdef ICE_CPP11_COMPILER
IceStormElection::ObserverInconsistencyException::~ObserverInconsistencyException()
{
}
#else
IceStormElection::ObserverInconsistencyException::~ObserverInconsistencyException() throw()
{
}
#endif

::std::string
IceStormElection::ObserverInconsistencyException::ice_id() const
{
    return "::IceStormElection::ObserverInconsistencyException";
}

IceStormElection::ObserverInconsistencyException*
IceStormElection::ObserverInconsistencyException::ice_clone() const
{
    return new ObserverInconsistencyException(*this);
}

void
IceStormElection::ObserverInconsistencyException::ice_throw() const
{
    throw *this;
}

/// \cond STREAM
void
IceStormElection::ObserverInconsistencyException::_writeImpl(::Ice::OutputStream* ostr) const
{
    ostr->startSlice("::IceStormElection::ObserverInconsistencyException", -1, true);
    ::Ice::StreamWriter< ObserverInconsistencyException, ::Ice::OutputStream>::write(ostr, *this);
    ostr->endSlice();
}

void
IceStormElection::ObserverInconsistencyException::_readImpl(::Ice::InputStream* istr)
{
    istr->startSlice();
    ::Ice::StreamReader< ObserverInconsistencyException, ::Ice::InputStream>::read(istr, *this);
    istr->endSlice();
}
/// \endcond

/// \cond INTERNAL
::IceProxy::Ice::Object* ::IceProxy::IceStormElection::upCast(ReplicaObserver* p) { return p; }

void
::IceProxy::IceStormElection::_readProxy(::Ice::InputStream* istr, ::IceInternal::ProxyHandle< ReplicaObserver>& v)
{
    ::Ice::ObjectPrx proxy;
    istr->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ReplicaObserver;
        v->_copyFrom(proxy);
    }
}
/// \endcond

::Ice::AsyncResultPtr
IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_init(const ::IceStormElection::LogUpdate& iceP_llu, const ::IceStormElection::TopicContentSeq& iceP_content, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_init_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_init_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_ReplicaObserver_init_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_llu);
        ostr->write(iceP_content);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_ReplicaObserver_init_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::ReplicaObserver::end_init(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_init_name);
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::IceStormElection::ObserverInconsistencyException&)
        {
            throw;
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    result->_readEmptyParams();
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_createTopic(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_createTopic_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_createTopic_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_ReplicaObserver_createTopic_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_llu);
        ostr->write(iceP_name);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_ReplicaObserver_createTopic_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::ReplicaObserver::end_createTopic(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_createTopic_name);
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::IceStormElection::ObserverInconsistencyException&)
        {
            throw;
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    result->_readEmptyParams();
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_destroyTopic(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_name, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_destroyTopic_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_destroyTopic_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_ReplicaObserver_destroyTopic_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_llu);
        ostr->write(iceP_name);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::ReplicaObserver::end_destroyTopic(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::IceStormElection::ObserverInconsistencyException&)
        {
            throw;
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    result->_readEmptyParams();
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_addSubscriber(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::IceStorm::SubscriberRecord& iceP_record, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_addSubscriber_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_addSubscriber_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_ReplicaObserver_addSubscriber_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_llu);
        ostr->write(iceP_topic);
        ostr->write(iceP_record);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::ReplicaObserver::end_addSubscriber(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::IceStormElection::ObserverInconsistencyException&)
        {
            throw;
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    result->_readEmptyParams();
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_removeSubscriber(const ::IceStormElection::LogUpdate& iceP_llu, const ::std::string& iceP_topic, const ::Ice::IdentitySeq& iceP_subscribers, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_llu);
        ostr->write(iceP_topic);
        ostr->write(iceP_subscribers);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::ReplicaObserver::end_removeSubscriber(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::IceStormElection::ObserverInconsistencyException&)
        {
            throw;
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    result->_readEmptyParams();
}

/// \cond INTERNAL
::IceProxy::Ice::Object*
IceProxy::IceStormElection::ReplicaObserver::_newInstance() const
{
    return new ReplicaObserver;
}
/// \endcond

const ::std::string&
IceProxy::IceStormElection::ReplicaObserver::ice_staticId()
{
    return ::IceStormElection::ReplicaObserver::ice_staticId();
}

/// \cond INTERNAL
::IceProxy::Ice::Object* ::IceProxy::IceStormElection::upCast(TopicManagerSync* p) { return p; }

void
::IceProxy::IceStormElection::_readProxy(::Ice::InputStream* istr, ::IceInternal::ProxyHandle< TopicManagerSync>& v)
{
    ::Ice::ObjectPrx proxy;
    istr->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new TopicManagerSync;
        v->_copyFrom(proxy);
    }
}
/// \endcond

::Ice::AsyncResultPtr
IceProxy::IceStormElection::TopicManagerSync::_iceI_begin_getContent(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_TopicManagerSync_getContent_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_TopicManagerSync_getContent_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_TopicManagerSync_getContent_name, ::Ice::Normal, context);
        result->writeEmptyParams();
        result->invoke(iceC_IceStormElection_TopicManagerSync_getContent_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::TopicManagerSync::end_getContent(::IceStormElection::LogUpdate& iceP_llu, ::IceStormElection::TopicContentSeq& iceP_content, const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_TopicManagerSync_getContent_name);
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    ::Ice::InputStream* istr = result->_startReadParams();
    istr->read(iceP_llu);
    istr->read(iceP_content);
    result->_endReadParams();
}

void IceProxy::IceStormElection::TopicManagerSync::_iceI_end_getContent(::IceStormElection::LogUpdate& iceP_llu, ::IceStormElection::TopicContentSeq& iceP_content, const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_TopicManagerSync_getContent_name);
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    ::Ice::InputStream* istr = result->_startReadParams();
    istr->read(iceP_llu);
    istr->read(iceP_content);
    result->_endReadParams();
}

/// \cond INTERNAL
::IceProxy::Ice::Object*
IceProxy::IceStormElection::TopicManagerSync::_newInstance() const
{
    return new TopicManagerSync;
}
/// \endcond

const ::std::string&
IceProxy::IceStormElection::TopicManagerSync::ice_staticId()
{
    return ::IceStormElection::TopicManagerSync::ice_staticId();
}

/// \cond INTERNAL
::IceProxy::Ice::Object* ::IceProxy::IceStormElection::upCast(Node* p) { return p; }

void
::IceProxy::IceStormElection::_readProxy(::Ice::InputStream* istr, ::IceInternal::ProxyHandle< Node>& v)
{
    ::Ice::ObjectPrx proxy;
    istr->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new Node;
        v->_copyFrom(proxy);
    }
}
/// \endcond

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_invitation(::Ice::Int iceP_j, const ::std::string& iceP_gn, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_invitation_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_invitation_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_j);
        ostr->write(iceP_gn);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_Node_invitation_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::Node::end_invitation(const ::Ice::AsyncResultPtr& result)
{
    _end(result, iceC_IceStormElection_Node_invitation_name);
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_ready(::Ice::Int iceP_j, const ::std::string& iceP_gn, const ::Ice::ObjectPrx& iceP_coordinator, ::Ice::Int iceP_max, ::Ice::Long iceP_generation, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_ready_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_ready_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_j);
        ostr->write(iceP_gn);
        ostr->write(iceP_coordinator);
        ostr->write(iceP_max);
        ostr->write(iceP_generation);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_Node_ready_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::Node::end_ready(const ::Ice::AsyncResultPtr& result)
{
    _end(result, iceC_IceStormElection_Node_ready_name);
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_accept(::Ice::Int iceP_j, const ::std::string& iceP_gn, const ::Ice::IntSeq& iceP_forwardedInvites, const ::Ice::ObjectPrx& iceP_observer, const ::IceStormElection::LogUpdate& iceP_llu, ::Ice::Int iceP_max, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_accept_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_accept_name, ::Ice::Normal, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_j);
        ostr->write(iceP_gn);
        ostr->write(iceP_forwardedInvites);
        ostr->write(iceP_observer);
        ostr->write(iceP_llu);
        ostr->write(iceP_max);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_Node_accept_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

void
IceProxy::IceStormElection::Node::end_accept(const ::Ice::AsyncResultPtr& result)
{
    _end(result, iceC_IceStormElection_Node_accept_name);
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_areYouCoordinator(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_areYouCoordinator_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_areYouCoordinator_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_areYouCoordinator_name, ::Ice::Idempotent, context);
        result->writeEmptyParams();
        result->invoke(iceC_IceStormElection_Node_areYouCoordinator_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

bool
IceProxy::IceStormElection::Node::end_areYouCoordinator(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_areYouCoordinator_name);
    bool ret;
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    ::Ice::InputStream* istr = result->_startReadParams();
    istr->read(ret);
    result->_endReadParams();
    return ret;
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_areYouThere(const ::std::string& iceP_gn, ::Ice::Int iceP_j, const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_areYouThere_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_areYouThere_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_areYouThere_name, ::Ice::Idempotent, context);
        ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
        ostr->write(iceP_gn);
        ostr->write(iceP_j);
        result->endWriteParams();
        result->invoke(iceC_IceStormElection_Node_areYouThere_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

bool
IceProxy::IceStormElection::Node::end_areYouThere(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_areYouThere_name);
    bool ret;
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    ::Ice::InputStream* istr = result->_startReadParams();
    istr->read(ret);
    result->_endReadParams();
    return ret;
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_sync(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_sync_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_sync_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_sync_name, ::Ice::Idempotent, context);
        result->writeEmptyParams();
        result->invoke(iceC_IceStormElection_Node_sync_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

::Ice::ObjectPrx
IceProxy::IceStormElection::Node::end_sync(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_sync_name);
    ::Ice::ObjectPrx ret;
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    ::Ice::InputStream* istr = result->_startReadParams();
    istr->read(ret);
    result->_endReadParams();
    return ret;
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_nodes(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_nodes_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_nodes_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_nodes_name, ::Ice::Idempotent, context);
        result->writeEmptyParams();
        result->invoke(iceC_IceStormElection_Node_nodes_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

::IceStormElection::NodeInfoSeq
IceProxy::IceStormElection::Node::end_nodes(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_nodes_name);
    ::IceStormElection::NodeInfoSeq ret;
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    ::Ice::InputStream* istr = result->_startReadParams();
    istr->read(ret);
    result->_endReadParams();
    return ret;
}

::Ice::AsyncResultPtr
IceProxy::IceStormElection::Node::_iceI_begin_query(const ::Ice::Context& context, const ::IceInternal::CallbackBasePtr& del, const ::Ice::LocalObjectPtr& cookie, bool sync)
{
    _checkTwowayOnly(iceC_IceStormElection_Node_query_name, sync);
    ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(this, iceC_IceStormElection_Node_query_name, del, cookie, sync);
    try
    {
        result->prepare(iceC_IceStormElection_Node_query_name, ::Ice::Idempotent, context);
        result->writeEmptyParams();
        result->invoke(iceC_IceStormElection_Node_query_name);
    }
    catch(const ::Ice::Exception& ex)
    {
        result->abort(ex);
    }
    return result;
}

::IceStormElection::QueryInfo
IceProxy::IceStormElection::Node::end_query(const ::Ice::AsyncResultPtr& result)
{
    ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_query_name);
    ::IceStormElection::QueryInfo ret;
    if(!result->_waitForResponse())
    {
        try
        {
            result->_throwUserException();
        }
        catch(const ::Ice::UserException& ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
        }
    }
    ::Ice::InputStream* istr = result->_startReadParams();
    istr->read(ret);
    result->_endReadParams();
    return ret;
}

/// \cond INTERNAL
::IceProxy::Ice::Object*
IceProxy::IceStormElection::Node::_newInstance() const
{
    return new Node;
}
/// \endcond

const ::std::string&
IceProxy::IceStormElection::Node::ice_staticId()
{
    return ::IceStormElection::Node::ice_staticId();
}

IceStormElection::ReplicaObserver::~ReplicaObserver()
{
}

/// \cond INTERNAL
::Ice::Object* IceStormElection::upCast(ReplicaObserver* p) { return p; }

/// \endcond

namespace
{
const ::std::string iceC_IceStormElection_ReplicaObserver_ids[2] =
{
    "::Ice::Object",
    "::IceStormElection::ReplicaObserver"
};

}

bool
IceStormElection::ReplicaObserver::ice_isA(const ::std::string& s, const ::Ice::Current&) const
{
    return ::std::binary_search(iceC_IceStormElection_ReplicaObserver_ids, iceC_IceStormElection_ReplicaObserver_ids + 2, s);
}

::std::vector< ::std::string>
IceStormElection::ReplicaObserver::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&iceC_IceStormElection_ReplicaObserver_ids[0], &iceC_IceStormElection_ReplicaObserver_ids[2]);
}

const ::std::string&
IceStormElection::ReplicaObserver::ice_id(const ::Ice::Current&) const
{
    return ice_staticId();
}

const ::std::string&
IceStormElection::ReplicaObserver::ice_staticId()
{
#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
    static const ::std::string typeId = "::IceStormElection::ReplicaObserver";
    return typeId;
#else
    return iceC_IceStormElection_ReplicaObserver_ids[1];
#endif
}

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_init(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    LogUpdate iceP_llu;
    TopicContentSeq iceP_content;
    istr->read(iceP_llu);
    istr->read(iceP_content);
    inS.endReadParams();
    this->init(iceP_llu, iceP_content, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_createTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_name;
    istr->read(iceP_llu);
    istr->read(iceP_name);
    inS.endReadParams();
    this->createTopic(iceP_llu, iceP_name, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_destroyTopic(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_name;
    istr->read(iceP_llu);
    istr->read(iceP_name);
    inS.endReadParams();
    this->destroyTopic(iceP_llu, iceP_name, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_addSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_topic;
    ::IceStorm::SubscriberRecord iceP_record;
    istr->read(iceP_llu);
    istr->read(iceP_topic);
    istr->read(iceP_record);
    inS.endReadParams();
    this->addSubscriber(iceP_llu, iceP_topic, iceP_record, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceD_removeSubscriber(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    LogUpdate iceP_llu;
    ::std::string iceP_topic;
    ::Ice::IdentitySeq iceP_subscribers;
    istr->read(iceP_llu);
    istr->read(iceP_topic);
    istr->read(iceP_subscribers);
    inS.endReadParams();
    this->removeSubscriber(iceP_llu, iceP_topic, iceP_subscribers, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

namespace
{
const ::std::string iceC_IceStormElection_ReplicaObserver_all[] =
{
    "addSubscriber",
    "createTopic",
    "destroyTopic",
    "ice_id",
    "ice_ids",
    "ice_isA",
    "ice_ping",
    "init",
    "removeSubscriber"
};

}

/// \cond INTERNAL
bool
IceStormElection::ReplicaObserver::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
{
    ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_ReplicaObserver_all, iceC_IceStormElection_ReplicaObserver_all + 9, current.operation);
    if(r.first == r.second)
    {
        throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
    }

    switch(r.first - iceC_IceStormElection_ReplicaObserver_all)
    {
        case 0:
        {
            return _iceD_addSubscriber(in, current);
        }
        case 1:
        {
            return _iceD_createTopic(in, current);
        }
        case 2:
        {
            return _iceD_destroyTopic(in, current);
        }
        case 3:
        {
            return _iceD_ice_id(in, current);
        }
        case 4:
        {
            return _iceD_ice_ids(in, current);
        }
        case 5:
        {
            return _iceD_ice_isA(in, current);
        }
        case 6:
        {
            return _iceD_ice_ping(in, current);
        }
        case 7:
        {
            return _iceD_init(in, current);
        }
        case 8:
        {
            return _iceD_removeSubscriber(in, current);
        }
        default:
        {
            assert(false);
            throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
        }
    }
}
/// \endcond

/// \cond STREAM
void
IceStormElection::ReplicaObserver::_iceWriteImpl(::Ice::OutputStream* ostr) const
{
    ostr->startSlice(ice_staticId(), -1, true);
    ::Ice::StreamWriter< ReplicaObserver, ::Ice::OutputStream>::write(ostr, *this);
    ostr->endSlice();
}

void
IceStormElection::ReplicaObserver::_iceReadImpl(::Ice::InputStream* istr)
{
    istr->startSlice();
    ::Ice::StreamReader< ReplicaObserver, ::Ice::InputStream>::read(istr, *this);
    istr->endSlice();
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::_icePatchObjectPtr(ReplicaObserverPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ReplicaObserverPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(ReplicaObserver::ice_staticId(), v);
    }
}
/// \endcond

IceStormElection::TopicManagerSync::~TopicManagerSync()
{
}

/// \cond INTERNAL
::Ice::Object* IceStormElection::upCast(TopicManagerSync* p) { return p; }

/// \endcond

namespace
{
const ::std::string iceC_IceStormElection_TopicManagerSync_ids[2] =
{
    "::Ice::Object",
    "::IceStormElection::TopicManagerSync"
};

}

bool
IceStormElection::TopicManagerSync::ice_isA(const ::std::string& s, const ::Ice::Current&) const
{
    return ::std::binary_search(iceC_IceStormElection_TopicManagerSync_ids, iceC_IceStormElection_TopicManagerSync_ids + 2, s);
}

::std::vector< ::std::string>
IceStormElection::TopicManagerSync::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&iceC_IceStormElection_TopicManagerSync_ids[0], &iceC_IceStormElection_TopicManagerSync_ids[2]);
}

const ::std::string&
IceStormElection::TopicManagerSync::ice_id(const ::Ice::Current&) const
{
    return ice_staticId();
}

const ::std::string&
IceStormElection::TopicManagerSync::ice_staticId()
{
#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
    static const ::std::string typeId = "::IceStormElection::TopicManagerSync";
    return typeId;
#else
    return iceC_IceStormElection_TopicManagerSync_ids[1];
#endif
}

/// \cond INTERNAL
bool
IceStormElection::TopicManagerSync::_iceD_getContent(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    inS.readEmptyParams();
    LogUpdate iceP_llu;
    TopicContentSeq iceP_content;
    this->getContent(iceP_llu, iceP_content, current);
    ::Ice::OutputStream* ostr = inS.startWriteParams();
    ostr->write(iceP_llu);
    ostr->write(iceP_content);
    inS.endWriteParams();
    return true;
}
/// \endcond

namespace
{
const ::std::string iceC_IceStormElection_TopicManagerSync_all[] =
{
    "getContent",
    "ice_id",
    "ice_ids",
    "ice_isA",
    "ice_ping"
};

}

/// \cond INTERNAL
bool
IceStormElection::TopicManagerSync::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
{
    ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_TopicManagerSync_all, iceC_IceStormElection_TopicManagerSync_all + 5, current.operation);
    if(r.first == r.second)
    {
        throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
    }

    switch(r.first - iceC_IceStormElection_TopicManagerSync_all)
    {
        case 0:
        {
            return _iceD_getContent(in, current);
        }
        case 1:
        {
            return _iceD_ice_id(in, current);
        }
        case 2:
        {
            return _iceD_ice_ids(in, current);
        }
        case 3:
        {
            return _iceD_ice_isA(in, current);
        }
        case 4:
        {
            return _iceD_ice_ping(in, current);
        }
        default:
        {
            assert(false);
            throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
        }
    }
}
/// \endcond

/// \cond STREAM
void
IceStormElection::TopicManagerSync::_iceWriteImpl(::Ice::OutputStream* ostr) const
{
    ostr->startSlice(ice_staticId(), -1, true);
    ::Ice::StreamWriter< TopicManagerSync, ::Ice::OutputStream>::write(ostr, *this);
    ostr->endSlice();
}

void
IceStormElection::TopicManagerSync::_iceReadImpl(::Ice::InputStream* istr)
{
    istr->startSlice();
    ::Ice::StreamReader< TopicManagerSync, ::Ice::InputStream>::read(istr, *this);
    istr->endSlice();
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::_icePatchObjectPtr(TopicManagerSyncPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = TopicManagerSyncPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(TopicManagerSync::ice_staticId(), v);
    }
}
/// \endcond

IceStormElection::Node::~Node()
{
}

/// \cond INTERNAL
::Ice::Object* IceStormElection::upCast(Node* p) { return p; }

/// \endcond

namespace
{
const ::std::string iceC_IceStormElection_Node_ids[2] =
{
    "::Ice::Object",
    "::IceStormElection::Node"
};

}

bool
IceStormElection::Node::ice_isA(const ::std::string& s, const ::Ice::Current&) const
{
    return ::std::binary_search(iceC_IceStormElection_Node_ids, iceC_IceStormElection_Node_ids + 2, s);
}

::std::vector< ::std::string>
IceStormElection::Node::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&iceC_IceStormElection_Node_ids[0], &iceC_IceStormElection_Node_ids[2]);
}

const ::std::string&
IceStormElection::Node::ice_id(const ::Ice::Current&) const
{
    return ice_staticId();
}

const ::std::string&
IceStormElection::Node::ice_staticId()
{
#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
    static const ::std::string typeId = "::IceStormElection::Node";
    return typeId;
#else
    return iceC_IceStormElection_Node_ids[1];
#endif
}

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_invitation(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    ::Ice::Int iceP_j;
    ::std::string iceP_gn;
    istr->read(iceP_j);
    istr->read(iceP_gn);
    inS.endReadParams();
    this->invitation(iceP_j, iceP_gn, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_ready(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    ::Ice::Int iceP_j;
    ::std::string iceP_gn;
    ::Ice::ObjectPrx iceP_coordinator;
    ::Ice::Int iceP_max;
    ::Ice::Long iceP_generation;
    istr->read(iceP_j);
    istr->read(iceP_gn);
    istr->read(iceP_coordinator);
    istr->read(iceP_max);
    istr->read(iceP_generation);
    inS.endReadParams();
    this->ready(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_accept(::IceInternal::Incoming& inS, const ::Ice::Current& current)
{
    _iceCheckMode(::Ice::Normal, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    ::Ice::Int iceP_j;
    ::std::string iceP_gn;
    ::Ice::IntSeq iceP_forwardedInvites;
    ::Ice::ObjectPrx iceP_observer;
    LogUpdate iceP_llu;
    ::Ice::Int iceP_max;
    istr->read(iceP_j);
    istr->read(iceP_gn);
    istr->read(iceP_forwardedInvites);
    istr->read(iceP_observer);
    istr->read(iceP_llu);
    istr->read(iceP_max);
    inS.endReadParams();
    this->accept(iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max, current);
    inS.writeEmptyParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_areYouCoordinator(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::Idempotent, current.mode);
    inS.readEmptyParams();
    bool ret = this->areYouCoordinator(current);
    ::Ice::OutputStream* ostr = inS.startWriteParams();
    ostr->write(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_areYouThere(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::Idempotent, current.mode);
    ::Ice::InputStream* istr = inS.startReadParams();
    ::std::string iceP_gn;
    ::Ice::Int iceP_j;
    istr->read(iceP_gn);
    istr->read(iceP_j);
    inS.endReadParams();
    bool ret = this->areYouThere(iceP_gn, iceP_j, current);
    ::Ice::OutputStream* ostr = inS.startWriteParams();
    ostr->write(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_sync(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::Idempotent, current.mode);
    inS.readEmptyParams();
    ::Ice::ObjectPrx ret = this->sync(current);
    ::Ice::OutputStream* ostr = inS.startWriteParams();
    ostr->write(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_nodes(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::Idempotent, current.mode);
    inS.readEmptyParams();
    NodeInfoSeq ret = this->nodes(current);
    ::Ice::OutputStream* ostr = inS.startWriteParams();
    ostr->write(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

/// \cond INTERNAL
bool
IceStormElection::Node::_iceD_query(::IceInternal::Incoming& inS, const ::Ice::Current& current) const
{
    _iceCheckMode(::Ice::Idempotent, current.mode);
    inS.readEmptyParams();
    QueryInfo ret = this->query(current);
    ::Ice::OutputStream* ostr = inS.startWriteParams();
    ostr->write(ret);
    inS.endWriteParams();
    return true;
}
/// \endcond

namespace
{
const ::std::string iceC_IceStormElection_Node_all[] =
{
    "accept",
    "areYouCoordinator",
    "areYouThere",
    "ice_id",
    "ice_ids",
    "ice_isA",
    "ice_ping",
    "invitation",
    "nodes",
    "query",
    "ready",
    "sync"
};

}

/// \cond INTERNAL
bool
IceStormElection::Node::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
{
    ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(iceC_IceStormElection_Node_all, iceC_IceStormElection_Node_all + 12, current.operation);
    if(r.first == r.second)
    {
        throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
    }

    switch(r.first - iceC_IceStormElection_Node_all)
    {
        case 0:
        {
            return _iceD_accept(in, current);
        }
        case 1:
        {
            return _iceD_areYouCoordinator(in, current);
        }
        case 2:
        {
            return _iceD_areYouThere(in, current);
        }
        case 3:
        {
            return _iceD_ice_id(in, current);
        }
        case 4:
        {
            return _iceD_ice_ids(in, current);
        }
        case 5:
        {
            return _iceD_ice_isA(in, current);
        }
        case 6:
        {
            return _iceD_ice_ping(in, current);
        }
        case 7:
        {
            return _iceD_invitation(in, current);
        }
        case 8:
        {
            return _iceD_nodes(in, current);
        }
        case 9:
        {
            return _iceD_query(in, current);
        }
        case 10:
        {
            return _iceD_ready(in, current);
        }
        case 11:
        {
            return _iceD_sync(in, current);
        }
        default:
        {
            assert(false);
            throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
        }
    }
}
/// \endcond

/// \cond STREAM
void
IceStormElection::Node::_iceWriteImpl(::Ice::OutputStream* ostr) const
{
    ostr->startSlice(ice_staticId(), -1, true);
    ::Ice::StreamWriter< Node, ::Ice::OutputStream>::write(ostr, *this);
    ostr->endSlice();
}

void
IceStormElection::Node::_iceReadImpl(::Ice::InputStream* istr)
{
    istr->startSlice();
    ::Ice::StreamReader< Node, ::Ice::InputStream>::read(istr, *this);
    istr->endSlice();
}
/// \endcond

/// \cond INTERNAL
void
IceStormElection::_icePatchObjectPtr(NodePtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = NodePtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(Node::ice_staticId(), v);
    }
}
/// \endcond

namespace Ice
{
}

#endif
