Ejemplo n.º 1
0
    void ServerBinding::invoke(
        const std::string &         subInterface,
        int                         fnId,
        RcfSession &                session)
    {
        // Check access control.

        {
            Lock lock(mMutex);
            if (mCbAccessControl)
            {
                bool ok = mCbAccessControl(fnId);
                if (!ok)
                {
                    RCF_THROW( RCF::Exception(_RcfError_ServerStubAccessDenied()));
                }
            }
        }

        // No mutex here, since there is never anyone writing to mInvokeFunctorMap.

        RCF_VERIFY(
            mInvokeFunctorMap.find(subInterface) != mInvokeFunctorMap.end(),
            Exception(_RcfError_UnknownInterface(subInterface)))
            (subInterface)(fnId)(mInvokeFunctorMap.size())(mMergedStubs.size());

        mInvokeFunctorMap[subInterface](fnId, session);
    }
Ejemplo n.º 2
0
    void ServerStub::invoke(
        const std::string &         subInterface,
        int                         fnId,
        RcfSession &                session)
    {
        // no mutex here, since there is never anyone writing to mInvokeFunctorMap

        RCF_VERIFY(
            mInvokeFunctorMap.find(subInterface) != mInvokeFunctorMap.end(),
            Exception(_RcfError_UnknownInterface(subInterface)))
            (subInterface)(fnId)(mInvokeFunctorMap.size())(mMergedStubs.size());

        mInvokeFunctorMap[subInterface](fnId, session);
    }