Ejemplo n.º 1
0
 void serialize(
     Archive &                           ar, 
     RcfClientT &                        rcfClient)
 {
     if (ar.isWrite())
     {
         rcfClient.mClientStubPtr ?
             ar & true & rcfClient.getClientStub() :
             ar & false;
     }
     else //if (ar.isRead())
     {
         bool hasClientStub = false;
         ar & hasClientStub;
         if (hasClientStub)
         {
             if (!rcfClient.mClientStubPtr)
             {
                 typedef typename RcfClientT::Interface Interface;
                 std::string interfaceName = getInterfaceName( (Interface*) 0);
                 ClientStubPtr clientStubPtr(new ClientStub(interfaceName));
                 rcfClient.setClientStubPtr(clientStubPtr);
             }
             ar & rcfClient.getClientStub();
         }
         else
         {
             rcfClient.setClientStubPtr( ClientStubPtr());
         }
     }
 }
Ejemplo n.º 2
0
 I_RcfClient::I_RcfClient(const std::string & interfaceName, const I_RcfClient & rhs)
 {
     mInterfaceName = interfaceName;
     if (rhs.getClientStubPtr())
     {
         const std::string & targetName = mInterfaceName;
         ClientStubPtr clientStubPtr( new ClientStub(rhs.getClientStub()));
         clientStubPtr->setInterfaceName(mInterfaceName);
         clientStubPtr->setTargetName(targetName);
         clientStubPtr->setTargetToken(Token());
         setClientStubPtr(clientStubPtr);
     }
 }
Ejemplo n.º 3
0
 I_RcfClient::I_RcfClient(
     const std::string &     interfaceName, 
     ClientTransportAutoPtr  clientTransportAutoPtr, 
     const std::string &     targetName_)
 {
     mInterfaceName = interfaceName;
     std::string targetName = targetName_;
     if (targetName.empty())
     {
         targetName = mInterfaceName;
     }
     ClientStubPtr clientStubPtr( new ClientStub(mInterfaceName, targetName) );
     clientStubPtr->setTransport(clientTransportAutoPtr);
     setClientStubPtr(clientStubPtr);
 }
Ejemplo n.º 4
0
 I_RcfClient::I_RcfClient(
     const std::string &     interfaceName, 
     const Endpoint &        endpoint, 
     const std::string &     targetName_)
 {
     mInterfaceName = interfaceName;
     std::string targetName = targetName_;
     if (targetName.empty())
     {
         targetName = mInterfaceName;
     }
     ClientStubPtr clientStubPtr( new ClientStub(mInterfaceName, targetName) );
     clientStubPtr->setEndpoint(endpoint);
     setClientStubPtr(clientStubPtr);
 }
Ejemplo n.º 5
0
 I_RcfClient::I_RcfClient(
     const std::string &     interfaceName, 
     const ClientStub &      clientStub, 
     const std::string &     targetName_)
 {
     mInterfaceName = interfaceName;
     std::string targetName = targetName_;
     if (targetName.empty())
     {
         targetName = mInterfaceName;
     }
     ClientStubPtr clientStubPtr( new ClientStub(clientStub) );
     clientStubPtr->setInterfaceName(mInterfaceName);
     clientStubPtr->setTargetName(targetName);
     clientStubPtr->setTargetToken(Token());
     setClientStubPtr(clientStubPtr);
 }
Ejemplo n.º 6
0
 I_RcfClient & I_RcfClient::operator=(const I_RcfClient & rhs)
 {
     if (&rhs != this)
     {
         if (rhs.mClientStubPtr)
         {
             ClientStubPtr clientStubPtr( new ClientStub(rhs.getClientStub()));
             setClientStubPtr(clientStubPtr);
         }
         else
         {
             RCF_ASSERT(!rhs.mServerStubPtr);
             mClientStubPtr = rhs.mClientStubPtr;
         }
     }
     return *this;
 }
Ejemplo n.º 7
0
        void serialize(
            Archive &                           ar, 
            RcfClientT &                        rcfClient,
            const unsigned int)
        {
            typedef typename Archive::is_saving IsSaving;
            const bool isSaving = IsSaving::value;

            if (isSaving)
            {
                bool hasClientStub = rcfClient.mClientStubPtr;
                ar & hasClientStub;
                if (hasClientStub)
                {
                    ar & rcfClient.getClientStub();
                }
            }
            else //if (ar.isRead())
            {
                bool hasClientStub = false;
                ar & hasClientStub;
                
                if (hasClientStub)
                {
                    if (!rcfClient.mClientStubPtr)
                    {
                        typedef typename RcfClientT::Interface Interface;
                        std::string interfaceName = getInterfaceName( (Interface*) 0);
                        ClientStubPtr clientStubPtr(new ClientStub(interfaceName));
                        rcfClient.setClientStubPtr(clientStubPtr);
                    }
                    ar & rcfClient.getClientStub();
                }
                else
                {
                    rcfClient.setClientStubPtr( ClientStubPtr());
                }
            }
        }