- rcf.zip
- RCF
- demo
- vs2003
- RCF
- doc
- include
- RCF
- SF
- license.txt
- src
- RCF
- SF
- test
- vs2003
- RCF
- RCF.sln
- RCF
- RCF.vcproj
- RCFTest
- RCFTest.vcproj
|
//*****************************************************************************
// RCF - Remote Call Framework
// Copyright (c) 2005, Jarl Lindrud.
// Contact: jlindrud@hotmail.com .
//
// Distributed under the so-called MIT license, see accompanying file license.txt.
//*****************************************************************************
#ifndef _RCF_SERVERSTUB_HPP_
#define _RCF_SERVERSTUB_HPP_
#include <RCF/Connection.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <RCF/Token.hpp>
namespace RCF {
class Connection;
class I_ServerStub
{
public:
virtual ~I_ServerStub() {}
virtual void invoke(int id, Connection &connection) = 0;
virtual void setToken(Token token) = 0;
virtual Token getToken() = 0;
};
template<typename StubT, typename ImplementationT>
class ServerStub : public I_ServerStub, boost::noncopyable
{
public:
ServerStub(ImplementationT &x);
ServerStub(std::auto_ptr<ImplementationT> px);
ServerStub(boost::shared_ptr<ImplementationT> px);
private:
void invoke(int id, RCF::Connection &connection);
template<typename IdT> void invoke(StubT &stub, const IdT &id, Connection &connection, ImplementationT &t);
Token getToken();
void setToken(Token token);
StubT stub;
Token token;
boost::shared_ptr<ImplementationT> px;
ImplementationT &x;
};
class StubAccess
{
public:
template<typename StubT, typename IdT, typename T>
void invoke(StubT &stub, const IdT &id, Connection &connection, T &t);
};
} // namespace RCF
#include <RCF/ServerStub.inl>
#endif // ! _RCF_SERVERSTUB_HPP_
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Software developer, from Sweden and now living in Canberra, Australia, working on distributed C++ applications. When he is not programming, Jarl enjoys skiing and playing table tennis. He derives immense satisfaction from referring to himself in third person.