18 #ifndef INCLUDE_RCF_METHODINVOCATION_HPP 19 #define INCLUDE_RCF_METHODINVOCATION_HPP 26 #include <RCF/ByteBuffer.hpp> 27 #include <RCF/Export.hpp> 28 #include <RCF/Exception.hpp> 29 #include <RCF/SerializationProtocol_Base.hpp> 36 typedef std::shared_ptr<RcfSession> RcfSessionPtr;
37 class SerializationProtocolIn;
38 class SerializationProtocolOut;
40 class MethodInvocationResponse;
41 class MethodInvocationRequest;
45 typedef std::shared_ptr<Filter> FilterPtr;
48 typedef std::shared_ptr<I_RcfClient> RcfClientPtr;
51 static const int Descriptor_Error = 0;
52 static const int Descriptor_Request = 1;
53 static const int Descriptor_Response = 2;
54 static const int Descriptor_FilteredPayload = 3;
56 void encodeServerError(RcfServer & server, ByteBuffer & byteBuffer,
int error);
57 void encodeServerError(RcfServer & server, ByteBuffer & byteBuffer,
int error,
int arg0,
int arg1);
93 class RCF_EXPORT MethodInvocationRequest : Noncopyable
96 MethodInvocationRequest();
102 const MethodInvocationRequest & rhs);
105 const std::string & service,
111 bool ignoreRuntimeVersion,
112 std::uint32_t pingBackIntervalMs,
114 bool enableSfPointerTracking,
115 bool enableNativeWstringSerialization);
118 bool getOneway()
const;
119 bool getClose()
const;
120 const std::string & getService()
const;
121 void setService(
const std::string &service);
122 int getPingBackIntervalMs();
127 const std::vector<ByteBuffer> & buffers,
128 std::vector<ByteBuffer> & message,
129 const std::vector<FilterPtr> & filters);
134 RcfSessionPtr rcfSessionPtr,
140 bool enableSfPointerTracking);
145 MethodInvocationResponse & response,
146 const std::vector<FilterPtr> & filters);
148 RcfClientPtr locateStubEntryPtr(
157 void decodeFromMessage(
161 RcfSessionPtr rcfSessionPtr,
162 const std::vector<FilterPtr> & existingFilters);
164 void encodeToMessage(
165 std::vector<ByteBuffer> & message,
166 const std::vector<ByteBuffer> & buffers,
167 const std::vector<FilterPtr> & filters);
169 std::string mService;
175 bool mIgnoreRuntimeVersion;
181 bool mEnableNativeWstringSerialization =
false;
185 std::shared_ptr<std::vector<char> > mVecPtr;
188 friend RCF::MemOstream& operator<<(RCF::MemOstream& os,
const MethodInvocationRequest& r);
191 class RCF_EXPORT MethodInvocationResponse
194 MethodInvocationResponse();
196 bool isException()
const;
197 bool isError()
const;
198 int getError()
const;
201 bool getEnableSfPointerTracking()
const;
203 std::unique_ptr<RemoteException> getExceptionPtr();
206 friend class MethodInvocationRequest;
209 typedef std::unique_ptr<RemoteException> RemoteExceptionPtr;
212 RemoteExceptionPtr mExceptionPtr;
219 friend RCF::MemOstream& operator<<(RCF::MemOstream& os,
const MethodInvocationResponse& r);
226 Omt_RequestTransportFilters = 1,
227 Omt_CreateCallbackConnection = 2,
228 Omt_RequestSubscription = 3,
229 Omt_RequestProxyConnection = 4,
233 typedef std::shared_ptr<OobMessage> OobMessagePtr;
234 typedef std::shared_ptr< std::vector<char> > VecPtr;
236 class RCF_EXPORT OobMessage
240 OobMessage(
int runtimeVersion);
241 virtual ~OobMessage();
243 virtual OobMessageType getMessageType() = 0;
245 virtual void encodeRequest(
ByteBuffer & buffer) = 0;
246 virtual void decodeRequest(
const ByteBuffer & buffer, std::size_t & pos) = 0;
248 virtual void encodeResponse(
ByteBuffer & buffer);
249 virtual void decodeResponse(
const ByteBuffer & buffer);
252 void encodeRequestCommon(VecPtr vecPtr, std::size_t & pos);
255 static OobMessagePtr decodeRequestCommon(
const ByteBuffer & buffer);
258 void encodeResponseCommon(VecPtr vecPtr, std::size_t & pos);
259 void decodeResponseCommon(
const ByteBuffer & buffer, std::size_t & pos);
266 std::uint32_t mResponseError;
267 std::string mResponseErrorString;
270 class RCF_EXPORT OobRequestTransportFilters :
public OobMessage
273 OobRequestTransportFilters(
int runtimeVersion);
275 OobRequestTransportFilters(
277 const std::vector<FilterPtr> &filters);
279 virtual OobMessageType getMessageType();
280 virtual void encodeRequest(
ByteBuffer & buffer);
281 virtual void decodeRequest(
const ByteBuffer & buffer, std::size_t & pos);
283 std::vector<std::int32_t> mFilterIds;
286 class RCF_EXPORT OobCreateCallbackConnection :
public OobMessage
289 OobCreateCallbackConnection(
int runtimeVersion);
291 virtual OobMessageType getMessageType();
292 virtual void encodeRequest(
ByteBuffer & buffer);
293 virtual void decodeRequest(
const ByteBuffer & buffer, std::size_t & pos);
296 class RCF_EXPORT OobRequestSubscription :
public OobMessage
299 OobRequestSubscription(
int runtimeVersion);
301 OobRequestSubscription(
303 const std::string & publisherName,
304 std::uint32_t subToPubPingIntervalMs);
306 virtual OobMessageType getMessageType();
307 virtual void encodeRequest(
ByteBuffer & buffer);
308 virtual void decodeRequest(
const ByteBuffer & buffer, std::size_t & pos);
309 virtual void encodeResponse(
ByteBuffer & buffer);
310 virtual void decodeResponse(
const ByteBuffer & buffer);
313 std::string mPublisherName;
314 std::uint32_t mSubToPubPingIntervalMs;
315 std::uint32_t mPubToSubPingIntervalMs;
318 class RCF_EXPORT OobRequestProxyConnection :
public OobMessage
321 OobRequestProxyConnection(
int runtimeVersion);
323 OobRequestProxyConnection(
325 const std::string & proxyEndpointName);
327 virtual OobMessageType getMessageType();
328 virtual void encodeRequest(
ByteBuffer & buffer);
329 virtual void decodeRequest(
const ByteBuffer & buffer, std::size_t & pos);
330 virtual void encodeResponse(
ByteBuffer & buffer);
331 virtual void decodeResponse(
const ByteBuffer & buffer);
333 std::string mProxyEndpointName;
339 #endif // ! INCLUDE_RCF_METHODINVOCATION_HPP Contains details about the currently executing remote call.
Definition: MethodInvocation.hpp:62
Represents a server side session, associated with a client connection.
Definition: RcfSession.hpp:64
SerializationProtocol mSerializationProtocol
Serialization protocol.
Definition: MethodInvocation.hpp:78
Controls the client side of a RCF connection.
Definition: ClientStub.hpp:82
SerializationProtocol
Describes which serialization implementation to use when serializing data structures for a remote cal...
Definition: Enums.hpp:166
std::uint32_t mPingBackIntervalMs
Pingback interval in ms.
Definition: MethodInvocation.hpp:87
int mFnId
RCF interface method ID.
Definition: MethodInvocation.hpp:72
std::string mServantBindingName
Servant binding name.
Definition: MethodInvocation.hpp:69
Provides RCF server-side functionality.
Definition: RcfServer.hpp:53
bool mEnableSfPointerTracking
Whether SF pointer tracking is enabled for serialization of parameters.
Definition: MethodInvocation.hpp:90
Represents an error that occurs on a RCF server and is transmitted back to the client.
Definition: Exception.hpp:168
Definition: ByteBuffer.hpp:39
int mRuntimeVersion
Runtime version.
Definition: MethodInvocation.hpp:81
Definition: AmiIoHandler.hpp:23
int mArchiveVersion
Archive version.
Definition: MethodInvocation.hpp:84
bool mOneway
True if the call is a oneway call.
Definition: MethodInvocation.hpp:75
RCF_EXPORT bool init(RcfConfigT *=nullptr)
Reference-counted initialization of RCF library. May be called multiple times (see deinit())...