⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 patch.cpp

📁 ice中间件 文件传输原代码 更新为服务形式
💻 CPP
📖 第 1 页 / 共 2 页
字号:
// **********************************************************************
//
// Copyright (c) 2003-2005 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.0.0
// Generated from file `Patch.ice'
#include "stdafx.h"
#include "Patch.h"
#include <Ice/LocalException.h>
#include <Ice/ObjectFactory.h>
#include <Ice/BasicStream.h>
#include <Ice/Object.h>

#ifndef ICE_IGNORE_VERSION
#   if ICE_INT_VERSION / 100 != 300
#       error Ice version mismatch!
#   endif
#   if ICE_INT_VERSION % 100 < 0
#       error Ice patch level mismatch!
#   endif
#endif

void
IceInternal::incRef(::Patch::UpdateServer* p)
{
    p->__incRef();
}

void
IceInternal::decRef(::Patch::UpdateServer* p)
{
    p->__decRef();
}

void
IceInternal::incRef(::IceProxy::Patch::UpdateServer* p)
{
    p->__incRef();
}

void
IceInternal::decRef(::IceProxy::Patch::UpdateServer* p)
{
    p->__decRef();
}

void
Patch::__write(::IceInternal::BasicStream* __os, const ::Patch::UpdateServerPrx& v)
{
    __os->write(::Ice::ObjectPrx(v));
}

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

void
Patch::__write(::IceInternal::BasicStream* __os, const ::Patch::UpdateServerPtr& v)
{
    __os->write(::Ice::ObjectPtr(v));
}

Patch::myException::myException(::Ice::Int __ice_iErrCode, const ::std::string& __ice_errDescription) :
#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
    UserException(),
#else
    ::Ice::UserException(),
#endif
    iErrCode(__ice_iErrCode),
    errDescription(__ice_errDescription)
{
}

static const char* __Patch__myException_name = "Patch::myException";

const ::std::string
Patch::myException::ice_name() const
{
    return __Patch__myException_name;
}

::Ice::Exception*
Patch::myException::ice_clone() const
{
    return new myException(*this);
}

void
Patch::myException::ice_throw() const
{
    throw *this;
}

void
Patch::myException::__write(::IceInternal::BasicStream* __os) const
{
    __os->write(::std::string("::Patch::myException"));
    __os->startWriteSlice();
    __os->write(iErrCode);
    __os->write(errDescription);
    __os->endWriteSlice();
}

void
Patch::myException::__read(::IceInternal::BasicStream* __is, bool __rid)
{
    if(__rid)
    {
	::std::string myId;
	__is->read(myId);
    }
    __is->startReadSlice();
    __is->read(iErrCode);
    __is->read(errDescription);
    __is->endReadSlice();
}

void
Patch::myException::__write(const ::Ice::OutputStreamPtr&) const
{
    Ice::MarshalException ex(__FILE__, __LINE__);
    ex.reason = "exception Patch::myException was not generated with stream support";
    throw ex;
}

void
Patch::myException::__read(const ::Ice::InputStreamPtr&, bool)
{
    Ice::MarshalException ex(__FILE__, __LINE__);
    ex.reason = "exception Patch::myException was not generated with stream support";
    throw ex;
}

struct __F__Patch__myException : public ::IceInternal::UserExceptionFactory
{
    virtual void
    createAndThrow()
    {
	throw ::Patch::myException();
    }
};

static ::IceInternal::UserExceptionFactoryPtr __F__Patch__myException__Ptr = new __F__Patch__myException;

const ::IceInternal::UserExceptionFactoryPtr&
Patch::myException::ice_factory()
{
    return __F__Patch__myException__Ptr;
}

class __F__Patch__myException__Init
{
public:

    __F__Patch__myException__Init()
    {
	::IceInternal::factoryTable->addExceptionFactory("::Patch::myException", ::Patch::myException::ice_factory());
    }

    ~__F__Patch__myException__Init()
    {
	::IceInternal::factoryTable->removeExceptionFactory("::Patch::myException");
    }
};

static __F__Patch__myException__Init __F__Patch__myException__i;

#ifdef __APPLE__
extern "C" { void __F__Patch__myException__initializer() {} }
#endif

IceAsync::Patch::AMD_UpdateServer_GetDataFromFile::AMD_UpdateServer_GetDataFromFile(::IceInternal::Incoming& in) :
    IncomingAsync(in)
{
}

void
IceAsync::Patch::AMD_UpdateServer_GetDataFromFile::ice_response(const ::Patch::ByteSeq& pBuf, const ::Patch::ByteSeq& hashValue, ::Ice::Int iReadSize)
{
    try
    {
	::IceInternal::BasicStream* __os = this->__os();
	__os->write(pBuf);
	__os->write(hashValue);
	__os->write(iReadSize);
    }
    catch(const ::Ice::Exception& __ex)
    {
	__exception(__ex);
	return;
    }
    __response(true);
}

void
IceAsync::Patch::AMD_UpdateServer_GetDataFromFile::ice_exception(const ::Ice::Exception& ex)
{
    try
    {
	ex.ice_throw();
    }
    catch(const ::Patch::myException& __ex)
    {
	__os()->write(__ex);
	__response(false);
    }
    catch(const ::Ice::Exception& __ex)
    {
	__exception(__ex);
    }
}

void
IceAsync::Patch::AMD_UpdateServer_GetDataFromFile::ice_exception(const ::std::exception& ex)
{
    __exception(ex);
}

void
IceAsync::Patch::AMD_UpdateServer_GetDataFromFile::ice_exception()
{
    __exception();
}

bool
IceProxy::Patch::UpdateServer::Init()
{
    return Init(__defaultContext());
}

bool
IceProxy::Patch::UpdateServer::Init(const ::Ice::Context& __ctx)
{
    int __cnt = 0;
    while(true)
    {
	try
	{
	    __checkTwowayOnly("Init");
	    ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
	    ::IceDelegate::Patch::UpdateServer* __del = dynamic_cast< ::IceDelegate::Patch::UpdateServer*>(__delBase.get());
	    return __del->Init(__ctx);
	}
	catch(const ::IceInternal::NonRepeatable& __ex)
	{
	    __rethrowException(*__ex.get());
	}
	catch(const ::Ice::LocalException& __ex)
	{
	    __handleException(__ex, __cnt);
	}
    }
}

bool
IceProxy::Patch::UpdateServer::isUpdate(const ::std::string& curVersion)
{
    return isUpdate(curVersion, __defaultContext());
}

bool
IceProxy::Patch::UpdateServer::isUpdate(const ::std::string& curVersion, const ::Ice::Context& __ctx)
{
    int __cnt = 0;
    while(true)
    {
	try
	{
	    __checkTwowayOnly("isUpdate");
	    ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
	    ::IceDelegate::Patch::UpdateServer* __del = dynamic_cast< ::IceDelegate::Patch::UpdateServer*>(__delBase.get());
	    return __del->isUpdate(curVersion, __ctx);
	}
	catch(const ::IceInternal::NonRepeatable& __ex)
	{
	    __handleException(*__ex.get(), __cnt);
	}
	catch(const ::Ice::LocalException& __ex)
	{
	    __handleException(__ex, __cnt);
	}
    }
}

void
IceProxy::Patch::UpdateServer::GetFileInfo(::std::string& fileName, ::Ice::Long& fileSize, ::std::string& updateVersion, ::Patch::ByteSeq& pFileHash)
{
    GetFileInfo(fileName, fileSize, updateVersion, pFileHash, __defaultContext());
}

void
IceProxy::Patch::UpdateServer::GetFileInfo(::std::string& fileName, ::Ice::Long& fileSize, ::std::string& updateVersion, ::Patch::ByteSeq& pFileHash, const ::Ice::Context& __ctx)
{
    int __cnt = 0;
    while(true)
    {
	try
	{
	    __checkTwowayOnly("GetFileInfo");
	    ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
	    ::IceDelegate::Patch::UpdateServer* __del = dynamic_cast< ::IceDelegate::Patch::UpdateServer*>(__delBase.get());
	    __del->GetFileInfo(fileName, fileSize, updateVersion, pFileHash, __ctx);
	    return;
	}
	catch(const ::IceInternal::NonRepeatable& __ex)
	{
	    __handleException(*__ex.get(), __cnt);
	}
	catch(const ::Ice::LocalException& __ex)
	{
	    __handleException(__ex, __cnt);
	}
    }
}

void
IceProxy::Patch::UpdateServer::GetDataFromFile(::Ice::Int iFilePos, ::Patch::ByteSeq& pBuf, ::Patch::ByteSeq& hashValue, ::Ice::Int& iReadSize)
{
    GetDataFromFile(iFilePos, pBuf, hashValue, iReadSize, __defaultContext());
}

void
IceProxy::Patch::UpdateServer::GetDataFromFile(::Ice::Int iFilePos, ::Patch::ByteSeq& pBuf, ::Patch::ByteSeq& hashValue, ::Ice::Int& iReadSize, const ::Ice::Context& __ctx)
{
    int __cnt = 0;
    while(true)
    {
	try
	{
	    __checkTwowayOnly("GetDataFromFile");
	    ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
	    ::IceDelegate::Patch::UpdateServer* __del = dynamic_cast< ::IceDelegate::Patch::UpdateServer*>(__delBase.get());
	    __del->GetDataFromFile(iFilePos, pBuf, hashValue, iReadSize, __ctx);
	    return;
	}
	catch(const ::IceInternal::NonRepeatable& __ex)
	{
	    __handleException(*__ex.get(), __cnt);
	}
	catch(const ::Ice::LocalException& __ex)
	{
	    __handleException(__ex, __cnt);
	}
    }
}

bool
IceProxy::Patch::UpdateServer::shutdown()
{
    return shutdown(__defaultContext());
}

bool
IceProxy::Patch::UpdateServer::shutdown(const ::Ice::Context& __ctx)
{
    int __cnt = 0;
    while(true)
    {
	try
	{
	    __checkTwowayOnly("shutdown");
	    ::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();
	    ::IceDelegate::Patch::UpdateServer* __del = dynamic_cast< ::IceDelegate::Patch::UpdateServer*>(__delBase.get());
	    return __del->shutdown(__ctx);
	}
	catch(const ::IceInternal::NonRepeatable& __ex)
	{
	    __handleException(*__ex.get(), __cnt);
	}
	catch(const ::Ice::LocalException& __ex)
	{
	    __handleException(__ex, __cnt);
	}
    }
}

const ::std::string&
IceProxy::Patch::UpdateServer::ice_staticId()
{
    return ::Patch::UpdateServer::ice_staticId();
}

::IceInternal::Handle< ::IceDelegateM::Ice::Object>
IceProxy::Patch::UpdateServer::__createDelegateM()
{
    return ::IceInternal::Handle< ::IceDelegateM::Ice::Object>(new ::IceDelegateM::Patch::UpdateServer);
}

::IceInternal::Handle< ::IceDelegateD::Ice::Object>
IceProxy::Patch::UpdateServer::__createDelegateD()
{
    return ::IceInternal::Handle< ::IceDelegateD::Ice::Object>(new ::IceDelegateD::Patch::UpdateServer);
}

bool
IceProxy::Patch::operator==(const ::IceProxy::Patch::UpdateServer& l, const ::IceProxy::Patch::UpdateServer& r)
{
    return static_cast<const ::IceProxy::Ice::Object&>(l) == static_cast<const ::IceProxy::Ice::Object&>(r);
}

bool
IceProxy::Patch::operator!=(const ::IceProxy::Patch::UpdateServer& l, const ::IceProxy::Patch::UpdateServer& r)
{
    return static_cast<const ::IceProxy::Ice::Object&>(l) != static_cast<const ::IceProxy::Ice::Object&>(r);
}

bool
IceProxy::Patch::operator<(const ::IceProxy::Patch::UpdateServer& l, const ::IceProxy::Patch::UpdateServer& r)
{
    return static_cast<const ::IceProxy::Ice::Object&>(l) < static_cast<const ::IceProxy::Ice::Object&>(r);
}

static const ::std::string __Patch__UpdateServer__Init_name = "Init";

bool
IceDelegateM::Patch::UpdateServer::Init(const ::Ice::Context& __context)
{
    ::IceInternal::Outgoing __og(__connection.get(), __reference.get(), __Patch__UpdateServer__Init_name, ::Ice::Normal, __context, __compress);
    bool __ok = __og.invoke();
    try
    {
	::IceInternal::BasicStream* __is = __og.is();
	if(!__ok)
	{
	    try
	    {
		__is->throwException();
	    }
	    catch(const ::Patch::myException&)
	    {
		throw;
	    }
	    catch(const ::Ice::UserException& __ex)
	    {
		throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
	    }
	}
	bool __ret;
	__is->read(__ret);
	return __ret;
    }
    catch(const ::Ice::LocalException& __ex)
    {
	throw ::IceInternal::NonRepeatable(__ex);
    }
}

static const ::std::string __Patch__UpdateServer__isUpdate_name = "isUpdate";

bool
IceDelegateM::Patch::UpdateServer::isUpdate(const ::std::string& curVersion, const ::Ice::Context& __context)
{
    ::IceInternal::Outgoing __og(__connection.get(), __reference.get(), __Patch__UpdateServer__isUpdate_name, ::Ice::Nonmutating, __context, __compress);
    try
    {
	::IceInternal::BasicStream* __os = __og.os();
	__os->write(curVersion);
    }
    catch(const ::Ice::LocalException& __ex)
    {
	__og.abort(__ex);
    }
    bool __ok = __og.invoke();
    try
    {
	::IceInternal::BasicStream* __is = __og.is();
	if(!__ok)
	{
	    try
	    {
		__is->throwException();
	    }
	    catch(const ::Ice::UserException& __ex)
	    {
		throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name());
	    }
	}
	bool __ret;
	__is->read(__ret);
	return __ret;
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -