19 #ifndef INCLUDE_RCF_RCFCLIENT_HPP
20 #define INCLUDE_RCF_RCFCLIENT_HPP
22 #include <boost/mpl/eval_if.hpp>
23 #include <boost/mpl/bool_fwd.hpp>
24 #include <boost/shared_ptr.hpp>
25 #include <boost/utility/enable_if.hpp>
27 #include <RCF/CheckRtti.hpp>
28 #include <RCF/ClientStub.hpp>
29 #include <RCF/Export.hpp>
37 typedef boost::shared_ptr<ClientStub> ClientStubPtr;
38 typedef boost::shared_ptr<ServerBinding> ServerBindingPtr;
40 typedef boost::function2<
43 RcfSession &> InvokeFunctor;
45 typedef std::map<std::string, InvokeFunctor> InvokeFunctorMap;
47 RCF_EXPORT
void setCurrentCallDesc(std::string& desc, RCF::MethodInvocationRequest& request,
const char * szFunc,
const char * szArity);
50 class RCF_EXPORT I_RcfClient
54 virtual ~I_RcfClient();
56 I_RcfClient(
const std::string & interfaceName);
59 const std::string & interfaceName,
60 ServerBindingPtr serverStubPtr);
63 const std::string & interfaceName,
64 const Endpoint & endpoint,
65 const std::string & targetName_ =
"");
68 const std::string & interfaceName,
69 ClientTransportAutoPtr clientTransportAutoPtr,
70 const std::string & targetName_ =
"");
73 const std::string & interfaceName,
74 const ClientStub & clientStub,
75 const std::string & targetName_ =
"");
78 const std::string & interfaceName,
79 const I_RcfClient & rhs);
81 I_RcfClient & operator=(
const I_RcfClient & rhs);
83 void swap(I_RcfClient & rhs);
85 void setClientStubPtr(ClientStubPtr clientStubPtr);
87 ClientStub & getClientStub();
88 const ClientStub & getClientStub()
const;
89 ClientStubPtr getClientStubPtr()
const;
90 ServerBindingPtr getServerStubPtr()
const;
91 ServerBinding & getServerStub();
95 ClientStubPtr mClientStubPtr;
96 ServerBindingPtr mServerStubPtr;
97 std::string mInterfaceName;
102 typedef boost::shared_ptr<I_RcfClient> RcfClientPtr;
106 typedef char (&yes_type)[1];
107 typedef char (&no_type)[2];
109 template<
typename U>
static yes_type RCF_hasRcfClientTypedef(
typename U::RcfClientT *);
110 template<
typename U>
static no_type RCF_hasRcfClientTypedef(...);
115 typedef typename T::RcfClientT type;
128 typedef typename boost::mpl::if_c<
129 sizeof(yes_type) ==
sizeof(RCF_hasRcfClientTypedef<T>(0)),
131 Identity<T> >::type type0;
133 typedef typename type0::type type;
136 class default_ {
char a[1]; };
137 class defined_ {
char a[2]; };
138 template<
typename T>
class Dummy {};
142 #endif // ! INCLUDE_RCF_RCFCLIENT_HPP