// **********************************************************************
//
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.6.4
//
// <auto-generated>
//
// Generated from file `Metrics.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//

#ifndef ICE_API_EXPORTS
#   define ICE_API_EXPORTS
#endif
#include <Ice/Metrics.h>
#include <IceUtil/PushDisableWarnings.h>
#include <Ice/LocalException.h>
#include <Ice/ObjectFactory.h>
#include <Ice/Outgoing.h>
#include <Ice/OutgoingAsync.h>
#include <Ice/BasicStream.h>
#include <IceUtil/Iterator.h>
#include <IceUtil/PopDisableWarnings.h>

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

namespace
{

const ::std::string __IceMX__MetricsAdmin__getMetricsViewNames_name = "getMetricsViewNames";

const ::std::string __IceMX__MetricsAdmin__enableMetricsView_name = "enableMetricsView";

const ::std::string __IceMX__MetricsAdmin__disableMetricsView_name = "disableMetricsView";

const ::std::string __IceMX__MetricsAdmin__getMetricsView_name = "getMetricsView";

const ::std::string __IceMX__MetricsAdmin__getMapMetricsFailures_name = "getMapMetricsFailures";

const ::std::string __IceMX__MetricsAdmin__getMetricsFailures_name = "getMetricsFailures";

}

namespace
{

const ::IceInternal::DefaultUserExceptionFactoryInit< ::IceMX::UnknownMetricsView> __IceMX__UnknownMetricsView_init("::IceMX::UnknownMetricsView");

}

IceMX::UnknownMetricsView::~UnknownMetricsView() throw()
{
}

::std::string
IceMX::UnknownMetricsView::ice_name() const
{
    return "IceMX::UnknownMetricsView";
}

IceMX::UnknownMetricsView*
IceMX::UnknownMetricsView::ice_clone() const
{
    return new UnknownMetricsView(*this);
}

void
IceMX::UnknownMetricsView::ice_throw() const
{
    throw *this;
}

void
IceMX::UnknownMetricsView::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice("::IceMX::UnknownMetricsView", -1, true);
    __os->endWriteSlice();
}

void
IceMX::UnknownMetricsView::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->endReadSlice();
}

namespace Ice
{
#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined(ICE_STATIC_LIBS)
template struct ICE_API StreamWriter< ::IceMX::MetricsFailures, ::IceInternal::BasicStream>;
template struct ICE_API StreamReader< ::IceMX::MetricsFailures, ::IceInternal::BasicStream>;
#endif
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::Metrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::Metrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::Metrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::Metrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::Metrics::ice_staticId()
{
    return ::IceMX::Metrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::Metrics::__newInstance() const
{
    return new Metrics;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::MetricsAdmin;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::MetricsAdmin* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::MetricsAdmin>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::MetricsAdmin;
        v->__copyFrom(proxy);
    }
}

::Ice::StringSeq
IceProxy::IceMX::MetricsAdmin::getMetricsViewNames(::Ice::StringSeq& __p_disabledViews, const ::Ice::Context* __ctx)
{
    __checkTwowayOnly(__IceMX__MetricsAdmin__getMetricsViewNames_name);
    ::IceInternal::Outgoing __og(this, __IceMX__MetricsAdmin__getMetricsViewNames_name, ::Ice::Normal, __ctx);
    __og.writeEmptyParams();
    if(!__og.invoke())
    {
        try
        {
            __og.throwUserException();
        }
        catch(const ::Ice::UserException& __ex)
        {
            ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());
            throw __uue;
        }
    }
    ::Ice::StringSeq __ret;
    ::IceInternal::BasicStream* __is = __og.startReadParams();
    __is->read(__p_disabledViews);
    __is->read(__ret);
    __og.endReadParams();
    return __ret;
}

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::begin_getMetricsViewNames(const ::Ice::Context* __ctx, const ::IceInternal::CallbackBasePtr& __del, const ::Ice::LocalObjectPtr& __cookie)
{
    __checkAsyncTwowayOnly(__IceMX__MetricsAdmin__getMetricsViewNames_name);
    ::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::OutgoingAsync(this, __IceMX__MetricsAdmin__getMetricsViewNames_name, __del, __cookie);
    try
    {
        __result->prepare(__IceMX__MetricsAdmin__getMetricsViewNames_name, ::Ice::Normal, __ctx);
        __result->writeEmptyParams();
        __result->invoke();
    }
    catch(const ::Ice::Exception& __ex)
    {
        __result->abort(__ex);
    }
    return __result;
}

#ifdef ICE_CPP11

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::__begin_getMetricsViewNames(const ::Ice::Context* __ctx, const ::IceInternal::Function<void (const ::Ice::StringSeq&, const ::Ice::StringSeq&)>& __response, const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception, const ::IceInternal::Function<void (bool)>& __sent)
{
    class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC
    {
    public:

        Cpp11CB(const ::std::function<void (const ::Ice::StringSeq&, const ::Ice::StringSeq&)>& responseFunc, const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, const ::std::function<void (bool)>& sentFunc) :
            ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc),
            _response(responseFunc)
        {
            CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
        }

        virtual void completed(const ::Ice::AsyncResultPtr& __result) const
        {
            ::IceMX::MetricsAdminPrx __proxy = ::IceMX::MetricsAdminPrx::uncheckedCast(__result->getProxy());
            ::Ice::StringSeq __p_disabledViews;
            ::Ice::StringSeq __ret;
            try
            {
                __ret = __proxy->end_getMetricsViewNames(__p_disabledViews, __result);
            }
            catch(const ::Ice::Exception& ex)
            {
                Cpp11FnCallbackNC::exception(__result, ex);
                return;
            }
            if(_response != nullptr)
            {
                _response(__ret, __p_disabledViews);
            }
        }
    
    private:
        
        ::std::function<void (const ::Ice::StringSeq&, const ::Ice::StringSeq&)> _response;
    };
    return begin_getMetricsViewNames(__ctx, new Cpp11CB(__response, __exception, __sent));
}
#endif

::Ice::StringSeq
IceProxy::IceMX::MetricsAdmin::end_getMetricsViewNames(::Ice::StringSeq& __p_disabledViews, const ::Ice::AsyncResultPtr& __result)
{
    ::Ice::AsyncResult::__check(__result, this, __IceMX__MetricsAdmin__getMetricsViewNames_name);
    ::Ice::StringSeq __ret;
    if(!__result->__wait())
    {
        try
        {
            __result->__throwUserException();
        }
        catch(const ::Ice::UserException& __ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
        }
    }
    ::IceInternal::BasicStream* __is = __result->__startReadParams();
    __is->read(__p_disabledViews);
    __is->read(__ret);
    __result->__endReadParams();
    return __ret;
}

void
IceProxy::IceMX::MetricsAdmin::enableMetricsView(const ::std::string& __p_name, const ::Ice::Context* __ctx)
{
    __checkTwowayOnly(__IceMX__MetricsAdmin__enableMetricsView_name);
    ::IceInternal::Outgoing __og(this, __IceMX__MetricsAdmin__enableMetricsView_name, ::Ice::Normal, __ctx);
    try
    {
        ::IceInternal::BasicStream* __os = __og.startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_name);
        __og.endWriteParams();
    }
    catch(const ::Ice::LocalException& __ex)
    {
        __og.abort(__ex);
    }
    if(!__og.invoke())
    {
        try
        {
            __og.throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());
            throw __uue;
        }
    }
}

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::begin_enableMetricsView(const ::std::string& __p_name, const ::Ice::Context* __ctx, const ::IceInternal::CallbackBasePtr& __del, const ::Ice::LocalObjectPtr& __cookie)
{
    __checkAsyncTwowayOnly(__IceMX__MetricsAdmin__enableMetricsView_name);
    ::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::OutgoingAsync(this, __IceMX__MetricsAdmin__enableMetricsView_name, __del, __cookie);
    try
    {
        __result->prepare(__IceMX__MetricsAdmin__enableMetricsView_name, ::Ice::Normal, __ctx);
        ::IceInternal::BasicStream* __os = __result->startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_name);
        __result->endWriteParams();
        __result->invoke();
    }
    catch(const ::Ice::Exception& __ex)
    {
        __result->abort(__ex);
    }
    return __result;
}

#ifdef ICE_CPP11

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::__begin_enableMetricsView(const ::std::string& __p_name, const ::Ice::Context* __ctx, const ::IceInternal::Function<void ()>& __response, const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception, const ::IceInternal::Function<void (bool)>& __sent)
{
    class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC
    {
    public:

        Cpp11CB(const ::std::function<void ()>& responseFunc, const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, const ::std::function<void (bool)>& sentFunc) :
            ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc),
            _response(responseFunc)
        {
            CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
        }

        virtual void completed(const ::Ice::AsyncResultPtr& __result) const
        {
            ::IceMX::MetricsAdminPrx __proxy = ::IceMX::MetricsAdminPrx::uncheckedCast(__result->getProxy());
            try
            {
                __proxy->end_enableMetricsView(__result);
            }
            catch(const ::Ice::Exception& ex)
            {
                Cpp11FnCallbackNC::exception(__result, ex);
                return;
            }
            if(_response != nullptr)
            {
                _response();
            }
        }
    
    private:
        
        ::std::function<void ()> _response;
    };
    return begin_enableMetricsView(__p_name, __ctx, new Cpp11CB(__response, __exception, __sent));
}
#endif

void
IceProxy::IceMX::MetricsAdmin::end_enableMetricsView(const ::Ice::AsyncResultPtr& __result)
{
    ::Ice::AsyncResult::__check(__result, this, __IceMX__MetricsAdmin__enableMetricsView_name);
    if(!__result->__wait())
    {
        try
        {
            __result->__throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
        }
    }
    __result->__readEmptyParams();
}

void
IceProxy::IceMX::MetricsAdmin::disableMetricsView(const ::std::string& __p_name, const ::Ice::Context* __ctx)
{
    __checkTwowayOnly(__IceMX__MetricsAdmin__disableMetricsView_name);
    ::IceInternal::Outgoing __og(this, __IceMX__MetricsAdmin__disableMetricsView_name, ::Ice::Normal, __ctx);
    try
    {
        ::IceInternal::BasicStream* __os = __og.startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_name);
        __og.endWriteParams();
    }
    catch(const ::Ice::LocalException& __ex)
    {
        __og.abort(__ex);
    }
    if(!__og.invoke())
    {
        try
        {
            __og.throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());
            throw __uue;
        }
    }
}

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::begin_disableMetricsView(const ::std::string& __p_name, const ::Ice::Context* __ctx, const ::IceInternal::CallbackBasePtr& __del, const ::Ice::LocalObjectPtr& __cookie)
{
    __checkAsyncTwowayOnly(__IceMX__MetricsAdmin__disableMetricsView_name);
    ::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::OutgoingAsync(this, __IceMX__MetricsAdmin__disableMetricsView_name, __del, __cookie);
    try
    {
        __result->prepare(__IceMX__MetricsAdmin__disableMetricsView_name, ::Ice::Normal, __ctx);
        ::IceInternal::BasicStream* __os = __result->startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_name);
        __result->endWriteParams();
        __result->invoke();
    }
    catch(const ::Ice::Exception& __ex)
    {
        __result->abort(__ex);
    }
    return __result;
}

#ifdef ICE_CPP11

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::__begin_disableMetricsView(const ::std::string& __p_name, const ::Ice::Context* __ctx, const ::IceInternal::Function<void ()>& __response, const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception, const ::IceInternal::Function<void (bool)>& __sent)
{
    class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC
    {
    public:

        Cpp11CB(const ::std::function<void ()>& responseFunc, const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, const ::std::function<void (bool)>& sentFunc) :
            ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc),
            _response(responseFunc)
        {
            CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
        }

        virtual void completed(const ::Ice::AsyncResultPtr& __result) const
        {
            ::IceMX::MetricsAdminPrx __proxy = ::IceMX::MetricsAdminPrx::uncheckedCast(__result->getProxy());
            try
            {
                __proxy->end_disableMetricsView(__result);
            }
            catch(const ::Ice::Exception& ex)
            {
                Cpp11FnCallbackNC::exception(__result, ex);
                return;
            }
            if(_response != nullptr)
            {
                _response();
            }
        }
    
    private:
        
        ::std::function<void ()> _response;
    };
    return begin_disableMetricsView(__p_name, __ctx, new Cpp11CB(__response, __exception, __sent));
}
#endif

void
IceProxy::IceMX::MetricsAdmin::end_disableMetricsView(const ::Ice::AsyncResultPtr& __result)
{
    ::Ice::AsyncResult::__check(__result, this, __IceMX__MetricsAdmin__disableMetricsView_name);
    if(!__result->__wait())
    {
        try
        {
            __result->__throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
        }
    }
    __result->__readEmptyParams();
}

::IceMX::MetricsView
IceProxy::IceMX::MetricsAdmin::getMetricsView(const ::std::string& __p_view, ::Ice::Long& __p_timestamp, const ::Ice::Context* __ctx)
{
    __checkTwowayOnly(__IceMX__MetricsAdmin__getMetricsView_name);
    ::IceInternal::Outgoing __og(this, __IceMX__MetricsAdmin__getMetricsView_name, ::Ice::Normal, __ctx);
    try
    {
        ::IceInternal::BasicStream* __os = __og.startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_view);
        __og.endWriteParams();
    }
    catch(const ::Ice::LocalException& __ex)
    {
        __og.abort(__ex);
    }
    if(!__og.invoke())
    {
        try
        {
            __og.throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());
            throw __uue;
        }
    }
    ::IceMX::MetricsView __ret;
    ::IceInternal::BasicStream* __is = __og.startReadParams();
    __is->read(__p_timestamp);
    __is->read(__ret);
    __is->readPendingObjects();
    __og.endReadParams();
    return __ret;
}

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::begin_getMetricsView(const ::std::string& __p_view, const ::Ice::Context* __ctx, const ::IceInternal::CallbackBasePtr& __del, const ::Ice::LocalObjectPtr& __cookie)
{
    __checkAsyncTwowayOnly(__IceMX__MetricsAdmin__getMetricsView_name);
    ::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::OutgoingAsync(this, __IceMX__MetricsAdmin__getMetricsView_name, __del, __cookie);
    try
    {
        __result->prepare(__IceMX__MetricsAdmin__getMetricsView_name, ::Ice::Normal, __ctx);
        ::IceInternal::BasicStream* __os = __result->startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_view);
        __result->endWriteParams();
        __result->invoke();
    }
    catch(const ::Ice::Exception& __ex)
    {
        __result->abort(__ex);
    }
    return __result;
}

#ifdef ICE_CPP11

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::__begin_getMetricsView(const ::std::string& __p_view, const ::Ice::Context* __ctx, const ::IceInternal::Function<void (const ::IceMX::MetricsView&, ::Ice::Long)>& __response, const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception, const ::IceInternal::Function<void (bool)>& __sent)
{
    class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC
    {
    public:

        Cpp11CB(const ::std::function<void (const ::IceMX::MetricsView&, ::Ice::Long)>& responseFunc, const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, const ::std::function<void (bool)>& sentFunc) :
            ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc),
            _response(responseFunc)
        {
            CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
        }

        virtual void completed(const ::Ice::AsyncResultPtr& __result) const
        {
            ::IceMX::MetricsAdminPrx __proxy = ::IceMX::MetricsAdminPrx::uncheckedCast(__result->getProxy());
            ::Ice::Long __p_timestamp;
            ::IceMX::MetricsView __ret;
            try
            {
                __ret = __proxy->end_getMetricsView(__p_timestamp, __result);
            }
            catch(const ::Ice::Exception& ex)
            {
                Cpp11FnCallbackNC::exception(__result, ex);
                return;
            }
            if(_response != nullptr)
            {
                _response(__ret, __p_timestamp);
            }
        }
    
    private:
        
        ::std::function<void (const ::IceMX::MetricsView&, ::Ice::Long)> _response;
    };
    return begin_getMetricsView(__p_view, __ctx, new Cpp11CB(__response, __exception, __sent));
}
#endif

::IceMX::MetricsView
IceProxy::IceMX::MetricsAdmin::end_getMetricsView(::Ice::Long& __p_timestamp, const ::Ice::AsyncResultPtr& __result)
{
    ::Ice::AsyncResult::__check(__result, this, __IceMX__MetricsAdmin__getMetricsView_name);
    ::IceMX::MetricsView __ret;
    if(!__result->__wait())
    {
        try
        {
            __result->__throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
        }
    }
    ::IceInternal::BasicStream* __is = __result->__startReadParams();
    __is->read(__p_timestamp);
    __is->read(__ret);
    __is->readPendingObjects();
    __result->__endReadParams();
    return __ret;
}

::IceMX::MetricsFailuresSeq
IceProxy::IceMX::MetricsAdmin::getMapMetricsFailures(const ::std::string& __p_view, const ::std::string& __p_map, const ::Ice::Context* __ctx)
{
    __checkTwowayOnly(__IceMX__MetricsAdmin__getMapMetricsFailures_name);
    ::IceInternal::Outgoing __og(this, __IceMX__MetricsAdmin__getMapMetricsFailures_name, ::Ice::Normal, __ctx);
    try
    {
        ::IceInternal::BasicStream* __os = __og.startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_view);
        __os->write(__p_map);
        __og.endWriteParams();
    }
    catch(const ::Ice::LocalException& __ex)
    {
        __og.abort(__ex);
    }
    if(!__og.invoke())
    {
        try
        {
            __og.throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());
            throw __uue;
        }
    }
    ::IceMX::MetricsFailuresSeq __ret;
    ::IceInternal::BasicStream* __is = __og.startReadParams();
    __is->read(__ret);
    __og.endReadParams();
    return __ret;
}

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::begin_getMapMetricsFailures(const ::std::string& __p_view, const ::std::string& __p_map, const ::Ice::Context* __ctx, const ::IceInternal::CallbackBasePtr& __del, const ::Ice::LocalObjectPtr& __cookie)
{
    __checkAsyncTwowayOnly(__IceMX__MetricsAdmin__getMapMetricsFailures_name);
    ::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::OutgoingAsync(this, __IceMX__MetricsAdmin__getMapMetricsFailures_name, __del, __cookie);
    try
    {
        __result->prepare(__IceMX__MetricsAdmin__getMapMetricsFailures_name, ::Ice::Normal, __ctx);
        ::IceInternal::BasicStream* __os = __result->startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_view);
        __os->write(__p_map);
        __result->endWriteParams();
        __result->invoke();
    }
    catch(const ::Ice::Exception& __ex)
    {
        __result->abort(__ex);
    }
    return __result;
}

#ifdef ICE_CPP11

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::__begin_getMapMetricsFailures(const ::std::string& __p_view, const ::std::string& __p_map, const ::Ice::Context* __ctx, const ::IceInternal::Function<void (const ::IceMX::MetricsFailuresSeq&)>& __response, const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception, const ::IceInternal::Function<void (bool)>& __sent)
{
    class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC
    {
    public:

        Cpp11CB(const ::std::function<void (const ::IceMX::MetricsFailuresSeq&)>& responseFunc, const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, const ::std::function<void (bool)>& sentFunc) :
            ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc),
            _response(responseFunc)
        {
            CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
        }

        virtual void completed(const ::Ice::AsyncResultPtr& __result) const
        {
            ::IceMX::MetricsAdminPrx __proxy = ::IceMX::MetricsAdminPrx::uncheckedCast(__result->getProxy());
            ::IceMX::MetricsFailuresSeq __ret;
            try
            {
                __ret = __proxy->end_getMapMetricsFailures(__result);
            }
            catch(const ::Ice::Exception& ex)
            {
                Cpp11FnCallbackNC::exception(__result, ex);
                return;
            }
            if(_response != nullptr)
            {
                _response(__ret);
            }
        }
    
    private:
        
        ::std::function<void (const ::IceMX::MetricsFailuresSeq&)> _response;
    };
    return begin_getMapMetricsFailures(__p_view, __p_map, __ctx, new Cpp11CB(__response, __exception, __sent));
}
#endif

::IceMX::MetricsFailuresSeq
IceProxy::IceMX::MetricsAdmin::end_getMapMetricsFailures(const ::Ice::AsyncResultPtr& __result)
{
    ::Ice::AsyncResult::__check(__result, this, __IceMX__MetricsAdmin__getMapMetricsFailures_name);
    ::IceMX::MetricsFailuresSeq __ret;
    if(!__result->__wait())
    {
        try
        {
            __result->__throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
        }
    }
    ::IceInternal::BasicStream* __is = __result->__startReadParams();
    __is->read(__ret);
    __result->__endReadParams();
    return __ret;
}

::IceMX::MetricsFailures
IceProxy::IceMX::MetricsAdmin::getMetricsFailures(const ::std::string& __p_view, const ::std::string& __p_map, const ::std::string& __p_id, const ::Ice::Context* __ctx)
{
    __checkTwowayOnly(__IceMX__MetricsAdmin__getMetricsFailures_name);
    ::IceInternal::Outgoing __og(this, __IceMX__MetricsAdmin__getMetricsFailures_name, ::Ice::Normal, __ctx);
    try
    {
        ::IceInternal::BasicStream* __os = __og.startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_view);
        __os->write(__p_map);
        __os->write(__p_id);
        __og.endWriteParams();
    }
    catch(const ::Ice::LocalException& __ex)
    {
        __og.abort(__ex);
    }
    if(!__og.invoke())
    {
        try
        {
            __og.throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            ::Ice::UnknownUserException __uue(__FILE__, __LINE__, __ex.ice_name());
            throw __uue;
        }
    }
    ::IceMX::MetricsFailures __ret;
    ::IceInternal::BasicStream* __is = __og.startReadParams();
    __is->read(__ret);
    __og.endReadParams();
    return __ret;
}

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::begin_getMetricsFailures(const ::std::string& __p_view, const ::std::string& __p_map, const ::std::string& __p_id, const ::Ice::Context* __ctx, const ::IceInternal::CallbackBasePtr& __del, const ::Ice::LocalObjectPtr& __cookie)
{
    __checkAsyncTwowayOnly(__IceMX__MetricsAdmin__getMetricsFailures_name);
    ::IceInternal::OutgoingAsyncPtr __result = new ::IceInternal::OutgoingAsync(this, __IceMX__MetricsAdmin__getMetricsFailures_name, __del, __cookie);
    try
    {
        __result->prepare(__IceMX__MetricsAdmin__getMetricsFailures_name, ::Ice::Normal, __ctx);
        ::IceInternal::BasicStream* __os = __result->startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_view);
        __os->write(__p_map);
        __os->write(__p_id);
        __result->endWriteParams();
        __result->invoke();
    }
    catch(const ::Ice::Exception& __ex)
    {
        __result->abort(__ex);
    }
    return __result;
}

#ifdef ICE_CPP11

::Ice::AsyncResultPtr
IceProxy::IceMX::MetricsAdmin::__begin_getMetricsFailures(const ::std::string& __p_view, const ::std::string& __p_map, const ::std::string& __p_id, const ::Ice::Context* __ctx, const ::IceInternal::Function<void (const ::IceMX::MetricsFailures&)>& __response, const ::IceInternal::Function<void (const ::Ice::Exception&)>& __exception, const ::IceInternal::Function<void (bool)>& __sent)
{
    class Cpp11CB : public ::IceInternal::Cpp11FnCallbackNC
    {
    public:

        Cpp11CB(const ::std::function<void (const ::IceMX::MetricsFailures&)>& responseFunc, const ::std::function<void (const ::Ice::Exception&)>& exceptionFunc, const ::std::function<void (bool)>& sentFunc) :
            ::IceInternal::Cpp11FnCallbackNC(exceptionFunc, sentFunc),
            _response(responseFunc)
        {
            CallbackBase::checkCallback(true, responseFunc || exceptionFunc != nullptr);
        }

        virtual void completed(const ::Ice::AsyncResultPtr& __result) const
        {
            ::IceMX::MetricsAdminPrx __proxy = ::IceMX::MetricsAdminPrx::uncheckedCast(__result->getProxy());
            ::IceMX::MetricsFailures __ret;
            try
            {
                __ret = __proxy->end_getMetricsFailures(__result);
            }
            catch(const ::Ice::Exception& ex)
            {
                Cpp11FnCallbackNC::exception(__result, ex);
                return;
            }
            if(_response != nullptr)
            {
                _response(__ret);
            }
        }
    
    private:
        
        ::std::function<void (const ::IceMX::MetricsFailures&)> _response;
    };
    return begin_getMetricsFailures(__p_view, __p_map, __p_id, __ctx, new Cpp11CB(__response, __exception, __sent));
}
#endif

::IceMX::MetricsFailures
IceProxy::IceMX::MetricsAdmin::end_getMetricsFailures(const ::Ice::AsyncResultPtr& __result)
{
    ::Ice::AsyncResult::__check(__result, this, __IceMX__MetricsAdmin__getMetricsFailures_name);
    ::IceMX::MetricsFailures __ret;
    if(!__result->__wait())
    {
        try
        {
            __result->__throwUserException();
        }
        catch(const ::IceMX::UnknownMetricsView&)
        {
            throw;
        }
        catch(const ::Ice::UserException& __ex)
        {
            throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
        }
    }
    ::IceInternal::BasicStream* __is = __result->__startReadParams();
    __is->read(__ret);
    __result->__endReadParams();
    return __ret;
}

const ::std::string&
IceProxy::IceMX::MetricsAdmin::ice_staticId()
{
    return ::IceMX::MetricsAdmin::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::MetricsAdmin::__newInstance() const
{
    return new MetricsAdmin;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::ThreadMetrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::ThreadMetrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::ThreadMetrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::ThreadMetrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::ThreadMetrics::ice_staticId()
{
    return ::IceMX::ThreadMetrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::ThreadMetrics::__newInstance() const
{
    return new ThreadMetrics;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::DispatchMetrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::DispatchMetrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::DispatchMetrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::DispatchMetrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::DispatchMetrics::ice_staticId()
{
    return ::IceMX::DispatchMetrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::DispatchMetrics::__newInstance() const
{
    return new DispatchMetrics;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::ChildInvocationMetrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::ChildInvocationMetrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::ChildInvocationMetrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::ChildInvocationMetrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::ChildInvocationMetrics::ice_staticId()
{
    return ::IceMX::ChildInvocationMetrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::ChildInvocationMetrics::__newInstance() const
{
    return new ChildInvocationMetrics;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::CollocatedMetrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::CollocatedMetrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::CollocatedMetrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::CollocatedMetrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::CollocatedMetrics::ice_staticId()
{
    return ::IceMX::CollocatedMetrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::CollocatedMetrics::__newInstance() const
{
    return new CollocatedMetrics;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::RemoteMetrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::RemoteMetrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::RemoteMetrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::RemoteMetrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::RemoteMetrics::ice_staticId()
{
    return ::IceMX::RemoteMetrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::RemoteMetrics::__newInstance() const
{
    return new RemoteMetrics;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::InvocationMetrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::InvocationMetrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::InvocationMetrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::InvocationMetrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::InvocationMetrics::ice_staticId()
{
    return ::IceMX::InvocationMetrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::InvocationMetrics::__newInstance() const
{
    return new InvocationMetrics;
}
#ifdef __SUNPRO_CC
class ICE_API IceProxy::IceMX::ConnectionMetrics;
#endif
ICE_API ::IceProxy::Ice::Object* ::IceProxy::IceMX::upCast(::IceProxy::IceMX::ConnectionMetrics* p) { return p; }

void
::IceProxy::IceMX::__read(::IceInternal::BasicStream* __is, ::IceInternal::ProxyHandle< ::IceProxy::IceMX::ConnectionMetrics>& v)
{
    ::Ice::ObjectPrx proxy;
    __is->read(proxy);
    if(!proxy)
    {
        v = 0;
    }
    else
    {
        v = new ::IceProxy::IceMX::ConnectionMetrics;
        v->__copyFrom(proxy);
    }
}

const ::std::string&
IceProxy::IceMX::ConnectionMetrics::ice_staticId()
{
    return ::IceMX::ConnectionMetrics::ice_staticId();
}

::IceProxy::Ice::Object*
IceProxy::IceMX::ConnectionMetrics::__newInstance() const
{
    return new ConnectionMetrics;
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::Metrics* p) { return p; }
::Ice::ObjectPtr
IceMX::Metrics::ice_clone() const
{
    ::Ice::Object* __p = new Metrics(*this);
    return __p;
}

namespace
{
const ::std::string __IceMX__Metrics_ids[2] =
{
    "::Ice::Object",
    "::IceMX::Metrics"
};

}

bool
IceMX::Metrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__Metrics_ids, __IceMX__Metrics_ids + 2, _s);
}

::std::vector< ::std::string>
IceMX::Metrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__Metrics_ids[0], &__IceMX__Metrics_ids[2]);
}

const ::std::string&
IceMX::Metrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__Metrics_ids[1];
}

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

void
IceMX::Metrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, true);
    __os->write(id);
    __os->write(total);
    __os->write(current);
    __os->write(totalLifetime);
    __os->write(failures);
    __os->endWriteSlice();
}

void
IceMX::Metrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->read(id);
    __is->read(total);
    __is->read(current);
    __is->read(totalLifetime);
    __is->read(failures);
    __is->endReadSlice();
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::Metrics> __IceMX__Metrics_init("::IceMX::Metrics");
}

::Ice::ObjectFactoryPtr
IceMX::Metrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::Metrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(MetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::MetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::Metrics::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::MetricsAdmin* p) { return p; }

namespace
{
const ::std::string __IceMX__MetricsAdmin_ids[2] =
{
    "::Ice::Object",
    "::IceMX::MetricsAdmin"
};

}

bool
IceMX::MetricsAdmin::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__MetricsAdmin_ids, __IceMX__MetricsAdmin_ids + 2, _s);
}

::std::vector< ::std::string>
IceMX::MetricsAdmin::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__MetricsAdmin_ids[0], &__IceMX__MetricsAdmin_ids[2]);
}

const ::std::string&
IceMX::MetricsAdmin::ice_id(const ::Ice::Current&) const
{
    return __IceMX__MetricsAdmin_ids[1];
}

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

::Ice::DispatchStatus
IceMX::MetricsAdmin::___getMetricsViewNames(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Normal, __current.mode);
    __inS.readEmptyParams();
    ::Ice::StringSeq __p_disabledViews;
    ::Ice::StringSeq __ret = getMetricsViewNames(__p_disabledViews, __current);
    ::IceInternal::BasicStream* __os = __inS.__startWriteParams(::Ice::SlicedFormat);
    __os->write(__p_disabledViews);
    __os->write(__ret);
    __inS.__endWriteParams(true);
    return ::Ice::DispatchOK;
}

::Ice::DispatchStatus
IceMX::MetricsAdmin::___enableMetricsView(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Normal, __current.mode);
    ::IceInternal::BasicStream* __is = __inS.startReadParams();
    ::std::string __p_name;
    __is->read(__p_name);
    __inS.endReadParams();
    try
    {
        enableMetricsView(__p_name, __current);
        __inS.__writeEmptyParams();
        return ::Ice::DispatchOK;
    }
    catch(const ::IceMX::UnknownMetricsView& __ex)
    {
        __inS.__writeUserException(__ex, ::Ice::SlicedFormat);
    }
    return ::Ice::DispatchUserException;
}

::Ice::DispatchStatus
IceMX::MetricsAdmin::___disableMetricsView(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Normal, __current.mode);
    ::IceInternal::BasicStream* __is = __inS.startReadParams();
    ::std::string __p_name;
    __is->read(__p_name);
    __inS.endReadParams();
    try
    {
        disableMetricsView(__p_name, __current);
        __inS.__writeEmptyParams();
        return ::Ice::DispatchOK;
    }
    catch(const ::IceMX::UnknownMetricsView& __ex)
    {
        __inS.__writeUserException(__ex, ::Ice::SlicedFormat);
    }
    return ::Ice::DispatchUserException;
}

::Ice::DispatchStatus
IceMX::MetricsAdmin::___getMetricsView(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Normal, __current.mode);
    ::IceInternal::BasicStream* __is = __inS.startReadParams();
    ::std::string __p_view;
    __is->read(__p_view);
    __inS.endReadParams();
    ::Ice::Long __p_timestamp;
    try
    {
        ::IceMX::MetricsView __ret = getMetricsView(__p_view, __p_timestamp, __current);
        ::IceInternal::BasicStream* __os = __inS.__startWriteParams(::Ice::SlicedFormat);
        __os->write(__p_timestamp);
        __os->write(__ret);
        __os->writePendingObjects();
        __inS.__endWriteParams(true);
        return ::Ice::DispatchOK;
    }
    catch(const ::IceMX::UnknownMetricsView& __ex)
    {
        __inS.__writeUserException(__ex, ::Ice::SlicedFormat);
    }
    return ::Ice::DispatchUserException;
}

::Ice::DispatchStatus
IceMX::MetricsAdmin::___getMapMetricsFailures(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Normal, __current.mode);
    ::IceInternal::BasicStream* __is = __inS.startReadParams();
    ::std::string __p_view;
    ::std::string __p_map;
    __is->read(__p_view);
    __is->read(__p_map);
    __inS.endReadParams();
    try
    {
        ::IceMX::MetricsFailuresSeq __ret = getMapMetricsFailures(__p_view, __p_map, __current);
        ::IceInternal::BasicStream* __os = __inS.__startWriteParams(::Ice::SlicedFormat);
        __os->write(__ret);
        __inS.__endWriteParams(true);
        return ::Ice::DispatchOK;
    }
    catch(const ::IceMX::UnknownMetricsView& __ex)
    {
        __inS.__writeUserException(__ex, ::Ice::SlicedFormat);
    }
    return ::Ice::DispatchUserException;
}

::Ice::DispatchStatus
IceMX::MetricsAdmin::___getMetricsFailures(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Normal, __current.mode);
    ::IceInternal::BasicStream* __is = __inS.startReadParams();
    ::std::string __p_view;
    ::std::string __p_map;
    ::std::string __p_id;
    __is->read(__p_view);
    __is->read(__p_map);
    __is->read(__p_id);
    __inS.endReadParams();
    try
    {
        ::IceMX::MetricsFailures __ret = getMetricsFailures(__p_view, __p_map, __p_id, __current);
        ::IceInternal::BasicStream* __os = __inS.__startWriteParams(::Ice::SlicedFormat);
        __os->write(__ret);
        __inS.__endWriteParams(true);
        return ::Ice::DispatchOK;
    }
    catch(const ::IceMX::UnknownMetricsView& __ex)
    {
        __inS.__writeUserException(__ex, ::Ice::SlicedFormat);
    }
    return ::Ice::DispatchUserException;
}

namespace
{
const ::std::string __IceMX__MetricsAdmin_all[] =
{
    "disableMetricsView",
    "enableMetricsView",
    "getMapMetricsFailures",
    "getMetricsFailures",
    "getMetricsView",
    "getMetricsViewNames",
    "ice_id",
    "ice_ids",
    "ice_isA",
    "ice_ping"
};

}

::Ice::DispatchStatus
IceMX::MetricsAdmin::__dispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
{
    ::std::pair< const ::std::string*, const ::std::string*> r = ::std::equal_range(__IceMX__MetricsAdmin_all, __IceMX__MetricsAdmin_all + 10, current.operation);
    if(r.first == r.second)
    {
        throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
    }

    switch(r.first - __IceMX__MetricsAdmin_all)
    {
        case 0:
        {
            return ___disableMetricsView(in, current);
        }
        case 1:
        {
            return ___enableMetricsView(in, current);
        }
        case 2:
        {
            return ___getMapMetricsFailures(in, current);
        }
        case 3:
        {
            return ___getMetricsFailures(in, current);
        }
        case 4:
        {
            return ___getMetricsView(in, current);
        }
        case 5:
        {
            return ___getMetricsViewNames(in, current);
        }
        case 6:
        {
            return ___ice_id(in, current);
        }
        case 7:
        {
            return ___ice_ids(in, current);
        }
        case 8:
        {
            return ___ice_isA(in, current);
        }
        case 9:
        {
            return ___ice_ping(in, current);
        }
    }

    assert(false);
    throw ::Ice::OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation);
}

void
IceMX::MetricsAdmin::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, true);
    __os->endWriteSlice();
}

void
IceMX::MetricsAdmin::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->endReadSlice();
}

void ICE_API 
IceMX::__patch(MetricsAdminPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::MetricsAdminPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::MetricsAdmin::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::ThreadMetrics* p) { return p; }
::Ice::ObjectPtr
IceMX::ThreadMetrics::ice_clone() const
{
    ::Ice::Object* __p = new ThreadMetrics(*this);
    return __p;
}

namespace
{
const ::std::string __IceMX__ThreadMetrics_ids[3] =
{
    "::Ice::Object",
    "::IceMX::Metrics",
    "::IceMX::ThreadMetrics"
};

}

bool
IceMX::ThreadMetrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__ThreadMetrics_ids, __IceMX__ThreadMetrics_ids + 3, _s);
}

::std::vector< ::std::string>
IceMX::ThreadMetrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__ThreadMetrics_ids[0], &__IceMX__ThreadMetrics_ids[3]);
}

const ::std::string&
IceMX::ThreadMetrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__ThreadMetrics_ids[2];
}

const ::std::string&
IceMX::ThreadMetrics::ice_staticId()
{
#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
    static const ::std::string typeId = "::IceMX::ThreadMetrics";
    return typeId;
#else
    return __IceMX__ThreadMetrics_ids[2];
#endif
}

void
IceMX::ThreadMetrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, false);
    __os->write(inUseForIO);
    __os->write(inUseForUser);
    __os->write(inUseForOther);
    __os->endWriteSlice();
    ::IceMX::Metrics::__writeImpl(__os);
}

void
IceMX::ThreadMetrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->read(inUseForIO);
    __is->read(inUseForUser);
    __is->read(inUseForOther);
    __is->endReadSlice();
    ::IceMX::Metrics::__readImpl(__is);
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::ThreadMetrics> __IceMX__ThreadMetrics_init("::IceMX::ThreadMetrics");
}

::Ice::ObjectFactoryPtr
IceMX::ThreadMetrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::ThreadMetrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(ThreadMetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::ThreadMetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::ThreadMetrics::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::DispatchMetrics* p) { return p; }
::Ice::ObjectPtr
IceMX::DispatchMetrics::ice_clone() const
{
    ::Ice::Object* __p = new DispatchMetrics(*this);
    return __p;
}

namespace
{
const ::std::string __IceMX__DispatchMetrics_ids[3] =
{
    "::Ice::Object",
    "::IceMX::DispatchMetrics",
    "::IceMX::Metrics"
};

}

bool
IceMX::DispatchMetrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__DispatchMetrics_ids, __IceMX__DispatchMetrics_ids + 3, _s);
}

::std::vector< ::std::string>
IceMX::DispatchMetrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__DispatchMetrics_ids[0], &__IceMX__DispatchMetrics_ids[3]);
}

const ::std::string&
IceMX::DispatchMetrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__DispatchMetrics_ids[1];
}

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

void
IceMX::DispatchMetrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, false);
    __os->write(userException);
    __os->write(size);
    __os->write(replySize);
    __os->endWriteSlice();
    ::IceMX::Metrics::__writeImpl(__os);
}

void
IceMX::DispatchMetrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->read(userException);
    __is->read(size);
    __is->read(replySize);
    __is->endReadSlice();
    ::IceMX::Metrics::__readImpl(__is);
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::DispatchMetrics> __IceMX__DispatchMetrics_init("::IceMX::DispatchMetrics");
}

::Ice::ObjectFactoryPtr
IceMX::DispatchMetrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::DispatchMetrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(DispatchMetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::DispatchMetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::DispatchMetrics::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::ChildInvocationMetrics* p) { return p; }
::Ice::ObjectPtr
IceMX::ChildInvocationMetrics::ice_clone() const
{
    ::Ice::Object* __p = new ChildInvocationMetrics(*this);
    return __p;
}

namespace
{
const ::std::string __IceMX__ChildInvocationMetrics_ids[3] =
{
    "::Ice::Object",
    "::IceMX::ChildInvocationMetrics",
    "::IceMX::Metrics"
};

}

bool
IceMX::ChildInvocationMetrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__ChildInvocationMetrics_ids, __IceMX__ChildInvocationMetrics_ids + 3, _s);
}

::std::vector< ::std::string>
IceMX::ChildInvocationMetrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__ChildInvocationMetrics_ids[0], &__IceMX__ChildInvocationMetrics_ids[3]);
}

const ::std::string&
IceMX::ChildInvocationMetrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__ChildInvocationMetrics_ids[1];
}

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

void
IceMX::ChildInvocationMetrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, false);
    __os->write(size);
    __os->write(replySize);
    __os->endWriteSlice();
    ::IceMX::Metrics::__writeImpl(__os);
}

void
IceMX::ChildInvocationMetrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->read(size);
    __is->read(replySize);
    __is->endReadSlice();
    ::IceMX::Metrics::__readImpl(__is);
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::ChildInvocationMetrics> __IceMX__ChildInvocationMetrics_init("::IceMX::ChildInvocationMetrics");
}

::Ice::ObjectFactoryPtr
IceMX::ChildInvocationMetrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::ChildInvocationMetrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(ChildInvocationMetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::ChildInvocationMetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::ChildInvocationMetrics::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::CollocatedMetrics* p) { return p; }
::Ice::ObjectPtr
IceMX::CollocatedMetrics::ice_clone() const
{
    ::Ice::Object* __p = new CollocatedMetrics(*this);
    return __p;
}

namespace
{
const ::std::string __IceMX__CollocatedMetrics_ids[4] =
{
    "::Ice::Object",
    "::IceMX::ChildInvocationMetrics",
    "::IceMX::CollocatedMetrics",
    "::IceMX::Metrics"
};

}

bool
IceMX::CollocatedMetrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__CollocatedMetrics_ids, __IceMX__CollocatedMetrics_ids + 4, _s);
}

::std::vector< ::std::string>
IceMX::CollocatedMetrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__CollocatedMetrics_ids[0], &__IceMX__CollocatedMetrics_ids[4]);
}

const ::std::string&
IceMX::CollocatedMetrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__CollocatedMetrics_ids[2];
}

const ::std::string&
IceMX::CollocatedMetrics::ice_staticId()
{
#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
    static const ::std::string typeId = "::IceMX::CollocatedMetrics";
    return typeId;
#else
    return __IceMX__CollocatedMetrics_ids[2];
#endif
}

void
IceMX::CollocatedMetrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, false);
    __os->endWriteSlice();
    ::IceMX::ChildInvocationMetrics::__writeImpl(__os);
}

void
IceMX::CollocatedMetrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->endReadSlice();
    ::IceMX::ChildInvocationMetrics::__readImpl(__is);
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::CollocatedMetrics> __IceMX__CollocatedMetrics_init("::IceMX::CollocatedMetrics");
}

::Ice::ObjectFactoryPtr
IceMX::CollocatedMetrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::CollocatedMetrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(CollocatedMetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::CollocatedMetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::CollocatedMetrics::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::RemoteMetrics* p) { return p; }
::Ice::ObjectPtr
IceMX::RemoteMetrics::ice_clone() const
{
    ::Ice::Object* __p = new RemoteMetrics(*this);
    return __p;
}

namespace
{
const ::std::string __IceMX__RemoteMetrics_ids[4] =
{
    "::Ice::Object",
    "::IceMX::ChildInvocationMetrics",
    "::IceMX::Metrics",
    "::IceMX::RemoteMetrics"
};

}

bool
IceMX::RemoteMetrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__RemoteMetrics_ids, __IceMX__RemoteMetrics_ids + 4, _s);
}

::std::vector< ::std::string>
IceMX::RemoteMetrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__RemoteMetrics_ids[0], &__IceMX__RemoteMetrics_ids[4]);
}

const ::std::string&
IceMX::RemoteMetrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__RemoteMetrics_ids[3];
}

const ::std::string&
IceMX::RemoteMetrics::ice_staticId()
{
#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
    static const ::std::string typeId = "::IceMX::RemoteMetrics";
    return typeId;
#else
    return __IceMX__RemoteMetrics_ids[3];
#endif
}

void
IceMX::RemoteMetrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, false);
    __os->endWriteSlice();
    ::IceMX::ChildInvocationMetrics::__writeImpl(__os);
}

void
IceMX::RemoteMetrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->endReadSlice();
    ::IceMX::ChildInvocationMetrics::__readImpl(__is);
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::RemoteMetrics> __IceMX__RemoteMetrics_init("::IceMX::RemoteMetrics");
}

::Ice::ObjectFactoryPtr
IceMX::RemoteMetrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::RemoteMetrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(RemoteMetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::RemoteMetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::RemoteMetrics::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::InvocationMetrics* p) { return p; }

#if defined(_MSC_VER) && (_MSC_VER >= 1900)
#   pragma warning(push)
#   pragma warning(disable:4589)
#endif
::Ice::ObjectPtr
IceMX::InvocationMetrics::ice_clone() const
{
    ::Ice::Object* __p = new InvocationMetrics(*this);
    return __p;
}
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
#   pragma warning(pop)
#endif

namespace
{
const ::std::string __IceMX__InvocationMetrics_ids[3] =
{
    "::Ice::Object",
    "::IceMX::InvocationMetrics",
    "::IceMX::Metrics"
};

}

bool
IceMX::InvocationMetrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__InvocationMetrics_ids, __IceMX__InvocationMetrics_ids + 3, _s);
}

::std::vector< ::std::string>
IceMX::InvocationMetrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__InvocationMetrics_ids[0], &__IceMX__InvocationMetrics_ids[3]);
}

const ::std::string&
IceMX::InvocationMetrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__InvocationMetrics_ids[1];
}

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

void
IceMX::InvocationMetrics::__gcVisitMembers(::IceInternal::GCVisitor& _v)
{
    {
        for(::IceMX::MetricsMap::iterator _i0 = remotes.begin(); _i0 != remotes.end(); ++_i0)
        {
            if((*_i0))
            {
                if((::IceMX::upCast((*_i0).get())->__gcVisit(_v)))
                {
                    (*_i0) = 0;
                }
            }
        }
    }
    {
        for(::IceMX::MetricsMap::iterator _i0 = collocated.begin(); _i0 != collocated.end(); ++_i0)
        {
            if((*_i0))
            {
                if((::IceMX::upCast((*_i0).get())->__gcVisit(_v)))
                {
                    (*_i0) = 0;
                }
            }
        }
    }
}

void
IceMX::InvocationMetrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, false);
    __os->write(retry);
    __os->write(userException);
    __os->write(remotes);
    __os->write(collocated);
    __os->endWriteSlice();
    ::IceMX::Metrics::__writeImpl(__os);
}

void
IceMX::InvocationMetrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->read(retry);
    __is->read(userException);
    __is->read(remotes);
    __is->read(collocated);
    __is->endReadSlice();
    ::IceMX::Metrics::__readImpl(__is);
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::InvocationMetrics> __IceMX__InvocationMetrics_init("::IceMX::InvocationMetrics");
}

::Ice::ObjectFactoryPtr
IceMX::InvocationMetrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::InvocationMetrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(InvocationMetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::InvocationMetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::InvocationMetrics::ice_staticId(), v);
    }
}

ICE_API ::Ice::Object* IceMX::upCast(::IceMX::ConnectionMetrics* p) { return p; }
::Ice::ObjectPtr
IceMX::ConnectionMetrics::ice_clone() const
{
    ::Ice::Object* __p = new ConnectionMetrics(*this);
    return __p;
}

namespace
{
const ::std::string __IceMX__ConnectionMetrics_ids[3] =
{
    "::Ice::Object",
    "::IceMX::ConnectionMetrics",
    "::IceMX::Metrics"
};

}

bool
IceMX::ConnectionMetrics::ice_isA(const ::std::string& _s, const ::Ice::Current&) const
{
    return ::std::binary_search(__IceMX__ConnectionMetrics_ids, __IceMX__ConnectionMetrics_ids + 3, _s);
}

::std::vector< ::std::string>
IceMX::ConnectionMetrics::ice_ids(const ::Ice::Current&) const
{
    return ::std::vector< ::std::string>(&__IceMX__ConnectionMetrics_ids[0], &__IceMX__ConnectionMetrics_ids[3]);
}

const ::std::string&
IceMX::ConnectionMetrics::ice_id(const ::Ice::Current&) const
{
    return __IceMX__ConnectionMetrics_ids[1];
}

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

void
IceMX::ConnectionMetrics::__writeImpl(::IceInternal::BasicStream* __os) const
{
    __os->startWriteSlice(ice_staticId(), -1, false);
    __os->write(receivedBytes);
    __os->write(sentBytes);
    __os->endWriteSlice();
    ::IceMX::Metrics::__writeImpl(__os);
}

void
IceMX::ConnectionMetrics::__readImpl(::IceInternal::BasicStream* __is)
{
    __is->startReadSlice();
    __is->read(receivedBytes);
    __is->read(sentBytes);
    __is->endReadSlice();
    ::IceMX::Metrics::__readImpl(__is);
}

namespace
{

const ::IceInternal::DefaultObjectFactoryInit< ::IceMX::ConnectionMetrics> __IceMX__ConnectionMetrics_init("::IceMX::ConnectionMetrics");
}

::Ice::ObjectFactoryPtr
IceMX::ConnectionMetrics::ice_factory()
{
    return ::IceInternal::factoryTable->getObjectFactory(::IceMX::ConnectionMetrics::ice_staticId());
}

void ICE_API 
IceMX::__patch(ConnectionMetricsPtr& handle, const ::Ice::ObjectPtr& v)
{
    handle = ::IceMX::ConnectionMetricsPtr::dynamicCast(v);
    if(v && !handle)
    {
        IceInternal::Ex::throwUOE(::IceMX::ConnectionMetrics::ice_staticId(), v);
    }
}
