• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RCF_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中RCF_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ RCF_ASSERT函数的具体用法?C++ RCF_ASSERT怎么用?C++ RCF_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了RCF_ASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: scheduleAmiNotification

    void ClientStub::onTimerExpired()
    {
        AsyncOpType opType = mAsyncOpType;
        mAsyncOpType = None;

        if (opType == Wait)
        {
            scheduleAmiNotification();
        }
        else
        {
            switch(opType)
            {
            case Connect:
                RCF_ASSERT(mEndpoint.get());
                
                onError(RCF::Exception(_RcfError_ClientConnectTimeout(
                    mConnectTimeoutMs, 
                    mEndpoint->asString())));

                break;

            case Write:
                onError(RCF::Exception(_RcfError_ClientWriteTimeout()));
                break;

            case Read: 
                onError(RCF::Exception(_RcfError_ClientReadTimeout()));
                break;

            default:
                RCF_ASSERT(0)(opType);
            };
        }        
    }
开发者ID:tsingcoo,项目名称:study,代码行数:35,代码来源:ClientStub.cpp


示例2: filterPtr

    void ClientStub::createFilterSequence(
        std::vector<FilterPtr> & filters)
    {
        filters.clear();
    
        // Setup compression if configured.
        if (mEnableCompression)
        {
#if RCF_FEATURE_ZLIB==1
            FilterPtr filterPtr( new ZlibStatefulCompressionFilter() );
            filters.push_back(filterPtr);
#else
            RCF_ASSERT(0);
#endif
        }

        FilterPtr filterPtr;
        if (mTransportProtocol != Tp_Clear && mTransportProtocol != Tp_Unspecified)
        {
            switch (mTransportProtocol)
            {
#if RCF_FEATURE_SSPI==1
            case Tp_Ntlm:       filterPtr.reset( new NtlmFilter(this) ); break;
            case Tp_Kerberos:   filterPtr.reset( new KerberosFilter(this) ); break;
            case Tp_Negotiate:  filterPtr.reset( new NegotiateFilter(this) ); break;
#endif

#if RCF_FEATURE_OPENSSL==1 && RCF_FEATURE_SSPI==1
            case Tp_Ssl:        if (mSslImplementation == Si_Schannel)
                                {
                                    filterPtr.reset( new SchannelFilter(this) ); 
                                }
                                else
                                {
                                    RCF_ASSERT(mSslImplementation == Si_OpenSsl);
                                    filterPtr.reset( new OpenSslEncryptionFilter(this) ); 
                                }
                                break;
#elif RCF_FEATURE_OPENSSL==1
            case Tp_Ssl:        filterPtr.reset( new OpenSslEncryptionFilter(this) ); break;
#elif RCF_FEATURE_SSPI==1
            case Tp_Ssl:        filterPtr.reset( new SchannelFilter(this) ); break;
#else
            // Single case just to keep the compiler warnings quiet.
            case Tp_Ssl:
#endif

            default:
                RCF_THROW( Exception( _RcfError_TransportProtocolNotSupported( getTransportProtocolName(mTransportProtocol)) ) );
            }
        }
        if (filterPtr)
        {
            filters.push_back(filterPtr);
        }
    }
开发者ID:crazyguymkii,项目名称:SWGEmuRPCServer,代码行数:56,代码来源:Filter.cpp


示例3: RCF_ASSERT

void AsioSessionState::onAppReadWriteCompleted(
    size_t bytesTransferred)
{
    RCF_ASSERT(!mReflecting);
    switch(mState)
    {
    case ReadingDataCount:
    case ReadingData:

        if (mTransport.mCustomFraming)
        {
            doCustomFraming(bytesTransferred);
        }
        else
        {
            doRegularFraming(bytesTransferred);
        }

        break;

    case WritingData:

        RCF_ASSERT_LTEQ(bytesTransferred , mWriteBufferRemaining);

        mWriteBufferRemaining -= bytesTransferred;
        if (mWriteBufferRemaining > 0)
        {
            beginWrite();
        }
        else
        {
            if (mCloseAfterWrite)
            {
                // For TCP sockets, call shutdown() so client receives
                // the message before we close the connection.

                implCloseAfterWrite();
            }
            else
            {
                mState = Ready;

                mSlicedWriteByteBuffers.resize(0);
                mWriteByteBuffers.resize(0);

                mTransport.getSessionManager().onWriteCompleted(
                    getSessionPtr());
            }
        }
        break;

    default:
        RCF_ASSERT(0);
    }
}
开发者ID:Jack-Tsue,项目名称:OnlineWhiteBoard,代码行数:55,代码来源:AsioServerTransport.cpp


示例4: RCF_ASSERT

    void ObjectPool::put(VecPtr & vecPtr)
    {
        RCF_ASSERT(vecPtr);
        RCF_ASSERT(vecPtr.unique());

        vecPtr->resize(0);

        Lock lock(mVecPtrPoolMutex);
        mVecPtrPool.push_back(vecPtr);
        vecPtr.reset();
    }
开发者ID:r0ssar00,项目名称:iTunesSpeechBridge,代码行数:11,代码来源:ObjectPool.cpp


示例5: TcpClientTransport

    HttpsClientTransport::HttpsClientTransport(const HttpsEndpoint & httpsEndpoint) : 
        TcpClientTransport(httpsEndpoint.getIp(), httpsEndpoint.getPort())
    {
        std::vector<FilterPtr> wireFilters;

        // HTTP framing.
        wireFilters.push_back( FilterPtr( new HttpFrameFilter(
            getRemoteAddr().getIp(), 
            getRemoteAddr().getPort())));

        // SSL.
        ClientStub * pClientStub = getTlsClientStubPtr();
        RCF_ASSERT(pClientStub);

        FilterPtr sslFilterPtr;

#if RCF_FEATURE_SSPI==1 && RCF_FEATURE_OPENSSL==1

        if (pClientStub->getSslImplementation() == Si_Schannel)
        {
            sslFilterPtr.reset( new SchannelFilter(pClientStub) );
        }
        else
        {
            RCF_ASSERT(pClientStub->getSslImplementation() == Si_OpenSsl);
            sslFilterPtr.reset( new OpenSslEncryptionFilter(pClientStub) );
        }

#elif RCF_FEATURE_SSPI==1

        sslFilterPtr.reset( new SchannelFilter(pClientStub) );

#elif RCF_FEATURE_OPENSSL==1

        sslFilterPtr.reset( new OpenSslEncryptionFilter(pClientStub) );

#endif

        if (!sslFilterPtr)
        {
            RCF_THROW( Exception(_RcfError_SslNotSupported()) );
        }

        wireFilters.push_back(sslFilterPtr);

        // HTTP CONNECT filter for passing through a proxy.
        wireFilters.push_back( FilterPtr( new HttpConnectFilter(
            getRemoteAddr().getIp(), 
            getRemoteAddr().getPort())));

        setWireFilters(wireFilters);
    }
开发者ID:MorelM35,项目名称:ESIR_MorKaneGame,代码行数:52,代码来源:HttpsClientTransport.cpp


示例6: RCF_UNUSED_VARIABLE

    void ServerObjectService::customDeleter(const std::string & objectKey, void * pt)
    {
        RCF_UNUSED_VARIABLE(pt);

        Lock lock(mMutex);

        ServerObjectMap::iterator iter = mServerObjectMap.find(objectKey);
        RCF_ASSERT(iter != mServerObjectMap.end());
        ServerObjectHolder & holder = iter->second;
        RCF_ASSERT(holder.mUseCount > 0);
        --holder.mUseCount;
        holder.mLastTouchMs = getCurrentTimeMs();
    }
开发者ID:huangjunfeng2000,项目名称:Rcf,代码行数:13,代码来源:ServerObjectService.cpp


示例7: RCF2_TRACE

    bool AsioServerTransport::cycle(
        int timeoutMs,
        const volatile bool &,// stopFlag
        bool returnEarly)
    {
        RCF2_TRACE("Entering cycle()");

        RCF_ASSERT(timeoutMs >= -1)(timeoutMs);

        mInterrupt = returnEarly;
        if (timeoutMs != -1)
        {
            mCycleTimerPtr->mImpl.cancel();

            mCycleTimerPtr->mImpl.expires_from_now(
                boost::posix_time::milliseconds(timeoutMs));

            mCycleTimerPtr->mImpl.async_wait( boost::bind(
                &AsioServerTransport::stopCycle, 
                this, 
                boost::asio::placeholders::error));
        }

        mDemuxerPtr->reset();
        mDemuxerPtr->run();

        RCF2_TRACE("Exiting cycle()");

        return false;
    }
开发者ID:r0ssar00,项目名称:iTunesSpeechBridge,代码行数:30,代码来源:AsioServerTransport.cpp


示例8: RCF_UNUSED_VARIABLE

    void SubscriptionService::onServerStop(RcfServer &server)
    {
        RCF_UNUSED_VARIABLE(server);

        mPeriodicTimer.stop();

        Subscriptions subs;

        {
            Lock writeLock(mSubscriptionsMutex);
            subs = mSubscriptions;
        }

        for (Subscriptions::iterator iter = subs.begin();
            iter != subs.end();
            ++iter)
        {
            SubscriptionPtr subscriptionPtr = iter->lock();
            if (subscriptionPtr)
            {
                subscriptionPtr->close();
            }
        }

        {
            Lock writeLock(mSubscriptionsMutex);
            RCF_ASSERT(mSubscriptions.empty());
        }

        mSubscriptions.clear();
        subs.clear();

        mpServer = NULL;
    }
开发者ID:eaglewei,项目名称:panda-svrkit,代码行数:34,代码来源:SubscriptionService.cpp


示例9: RCF_ASSERT

    void Win32NamedPipeSessionState::reconnect()
    {
        RCF_ASSERT(mEnableReconnect && mOwnFd);

        BOOL ok = DisconnectNamedPipe(mhPipe);
        DWORD dwErr = GetLastError();
        RCF_ASSERT(ok)(dwErr);
        
        mSessionPtr.reset();
        mSessionPtr = mTransport.mpSessionManager->createSession();
        mSessionPtr->setProactor(*this);

        resetState();

        accept();
    }
开发者ID:r0ssar00,项目名称:iTunesSpeechBridge,代码行数:16,代码来源:Win32NamedPipeServerTransport.cpp


示例10: getWorkingDir

std::string getWorkingDir()
{
    std::vector<char> vec(1024);
    char * szRet = getcwd(&vec[0], static_cast<int>( vec.size() ));
    RCF_ASSERT(szRet);
    return std::string(&vec[0]);
}
开发者ID:crazyguymkii,项目名称:SWGEmuRPCServer,代码行数:7,代码来源:Test.cpp


示例11: RCF_ASSERT

    std::size_t Win32NamedPipeClientTransport::implWrite(
        const std::vector<ByteBuffer> &byteBuffers)
    {
        // For now, can't go back to sync calls after doing an async call.
        // Limitations with Windows IOCP.
        RCF_ASSERT(!mAsyncMode);

        // Not using overlapped I/O here because it interferes with the
        // server session that might be coupled to this transport.

        const ByteBuffer & byteBuffer = byteBuffers.front();

        DWORD count = 0;
        DWORD dwBytesToWrite = static_cast<DWORD>(byteBuffer.getLength());

        BOOL ok = WriteFile( 
            mhPipe,
            byteBuffer.getPtr(),
            dwBytesToWrite,
            &count,
            NULL);

        DWORD dwErr = GetLastError();

        RCF_VERIFY(ok, Exception(_RcfError_ClientWriteFail(), dwErr));

        // Strangely, WriteFile() sometimes returns 1, but at the same time a much too big value in count.
        RCF_VERIFY(count <= dwBytesToWrite, Exception(_RcfError_ClientWriteFail(), dwErr))(count)(dwBytesToWrite);

        RCF_VERIFY(count > 0, Exception(_RcfError_ClientWriteFail(), dwErr))(count)(dwBytesToWrite);

        onTimedSendCompleted( RCF_MIN(count, dwBytesToWrite), 0);

        return count;
    }
开发者ID:crazyguymkii,项目名称:SWGEmuRPCServer,代码行数:35,代码来源:Win32NamedPipeClientTransport.cpp


示例12: RCF_ASSERT

    void SubscriptionService::createSubscriptionImplBegin(
        RcfClientPtr rcfClientPtr, 
        const SubscriptionParms & parms,
        const std::string & defaultPublisherName)
    {
        ClientStub & clientStub = const_cast<ClientStub &>(parms.mClientStub);
        OnSubscriptionDisconnect onDisconnect = parms.mOnDisconnect;
        std::string publisherName = parms.mPublisherName;
        OnAsyncSubscribeCompleted onCompletion = parms.mOnAsyncSubscribeCompleted;

        if (publisherName.empty())
        {
            publisherName = defaultPublisherName;
        }
        
        RCF_ASSERT(onCompletion);

        if (clientStub.getRuntimeVersion() <= 11)
        {
            doRequestSubscriptionAsync_Legacy(
                clientStub, 
                publisherName, 
                rcfClientPtr,
                parms);
        }
        else
        {
            doRequestSubscriptionAsync(
                clientStub, 
                publisherName, 
                rcfClientPtr,
                parms);
        }
    }
开发者ID:huangjunfeng2000,项目名称:Rcf,代码行数:34,代码来源:SubscriptionService.cpp


示例13: createSessionObject

 T & createSessionObject()
 {
     deleteSessionObject<T>();
     T * pt = getSessionObjectImpl<T>(true);
     RCF_ASSERT(pt);
     return *pt; 
 }
开发者ID:Fruneng,项目名称:POI_DB,代码行数:7,代码来源:RcfSession.hpp


示例14: read

        void read(T &t)
        {
            try
            {
                switch (mProtocol)
                {
                case 1: mInProtocol1 >> t; break;
                case 2: mInProtocol2 >> t; break;
                case 3: mInProtocol3 >> t; break;
                case 4: mInProtocol4 >> t; break;

#ifdef RCF_USE_BOOST_XML_SERIALIZATION
                case 5: mInProtocol5 >> boost::serialization::make_nvp("Dummy", t); break;
#else
                case 5: mInProtocol5 >> t; break;
#endif

                default: RCF_ASSERT(0)(mProtocol);
                }
            }
            catch(const RCF::Exception &e)
            {
                RCF_UNUSED_VARIABLE(e);
                throw;
            }
            catch(const std::exception &e)
            {
                RCF::SerializationException se( _RcfError_Deserialization(
                    typeid(t).name(), 
                    typeid(e).name(), 
                    e.what()));

                RCF_THROW(se);
            }
        }
开发者ID:Jack-Tsue,项目名称:OnlineWhiteBoard,代码行数:35,代码来源:SerializationProtocol.hpp


示例15: getSessionObjectImpl

        T * getSessionObjectImpl(bool createIfDoesntExist)
        {
            typedef boost::shared_ptr<T> TPtr;

            const std::type_info & whichType = typeid(T);
            const std::type_info * pWhichType = &whichType;

            SessionObjectMap::iterator iter = mSessionObjects.find(pWhichType);
            if (iter != mSessionObjects.end())
            {
                boost::any & a = iter->second;
                TPtr * ptPtr = boost::any_cast<TPtr>(&a);
                RCF_ASSERT(ptPtr && *ptPtr);
                return ptPtr->get();
            }
            else if (createIfDoesntExist)
            {
                TPtr tPtr( new T() );
                mSessionObjects[pWhichType] = tPtr;
                return tPtr.get();
            }
            else
            {
                return NULL;
            }
        }
开发者ID:Fruneng,项目名称:POI_DB,代码行数:26,代码来源:RcfSession.hpp


示例16: RCF_UNUSED_VARIABLE

    void PublishingService::onServerStop(RcfServer &server)
    {
        RCF_UNUSED_VARIABLE(server);
        mPeriodicTimer.stop();

        // Close all publishers.

        Publishers publishers;
        {
            Lock writeLock(mPublishersMutex);
            publishers = mPublishers;
        }

        Publishers::iterator iter;
        for (iter = publishers.begin(); iter != publishers.end(); ++iter)
        {
            PublisherPtr publisherPtr = iter->second.lock();
            if (publisherPtr)
            {
                publisherPtr->close();
            }
        }

        {
            Lock writeLock(mPublishersMutex);
            RCF_ASSERT(mPublishers.empty());
        }
    }
开发者ID:crazyguymkii,项目名称:SWGEmuRPCServer,代码行数:28,代码来源:PublishingService.cpp


示例17: read

 UInt32 IStream::read_int(UInt32 &n)
 {
     if (mRuntimeVersion < 9)
     {
         UInt32 bytesRead = read( reinterpret_cast<SF::Byte8 *>(&n), 4);
         RCF::networkToMachineOrder( &n, 4, 1);
         return bytesRead;
     }
     else
     {
         // Integers less than 128 are stored as a single byte.
         Byte8 byte = 0;
         boost::uint8_t ubyte = 0;
         UInt32 bytesRead = read_byte(byte);
         ubyte = byte;
         if (ubyte < 128)
         {
             n = ubyte;
         }
         else
         {
             RCF_ASSERT(ubyte == 128);
             bytesRead += read( reinterpret_cast<SF::Byte8 *>(&n), 4);
             RCF::networkToMachineOrder( &n, 4, 1);
         }
         return bytesRead;
     }
 }
开发者ID:MorelM35,项目名称:ESIR_MorKaneGame,代码行数:28,代码来源:Stream.cpp


示例18: read

        void read(T &t)
        {
            try
            {
                switch (mProtocol)
                {
                case 1: mInProtocol1 >> t; break;
                case 2: mInProtocol2 >> t; break;
                case 3: mInProtocol3 >> t; break;
                case 4: mInProtocol4 >> t; break;
                case 5: mInProtocol5 >> t; break;

                default: RCF_ASSERT(0)(mProtocol);
                }
            }
            catch(const RCF::Exception &e)
            {
                RCF_UNUSED_VARIABLE(e);
                throw;
            }
            catch(const std::exception &e)
            {
                RCF::SerializationException se( _RcfError_Deserialization(
                    typeid(t).name(), 
                    typeid(e).name(), 
                    e.what()));

                RCF_THROW(se);
            }
        }
开发者ID:MorelM35,项目名称:ESIR_MorKaneGame,代码行数:30,代码来源:SerializationProtocol.hpp


示例19: RCF_ASSERT

    void CallbackConnectionService::CreateCallbackConnection()
    {
        // TODO: regular error message.
        // ...
        RCF_ASSERT( mOnCallbackConnectionCreated );

        RCF::convertRcfSessionToRcfClient( mOnCallbackConnectionCreated );
    }
开发者ID:eaglewei,项目名称:panda-svrkit,代码行数:8,代码来源:PublishingService.cpp


示例20: RCF_ASSERT

 void InProcessTransport::setTimer(
     boost::uint32_t timeoutMs,
     I_ClientTransportCallback * pClientStub)
 {
     RCF_ASSERT(0);
     RCF_UNUSED_VARIABLE(timeoutMs);
     RCF_UNUSED_VARIABLE(pClientStub);
 }
开发者ID:Jack-Tsue,项目名称:OnlineWhiteBoard,代码行数:8,代码来源:InProcessTransport.cpp



注:本文中的RCF_ASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RCLASS_IV_TBL函数代码示例发布时间:2022-05-30
下一篇:
C++ RCC_WaitForHSEStartUp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap