usb: getting string descriptors, minor improvements
[quarnos.git] / manes / ods / call_serializer.h
blob1da5369ac3f7b01d2c6b3ec7d23893c0e25bc627
1 #ifndef _CALL_SERIALIZER_H_
2 #define _CALL_SERIALIZER_H_
4 #include "obj_ref.h"
5 #include "obj_val.h"
7 #include "libs/pointer.h"
8 #include "libs/buffer.h"
10 namespace manes {
11 namespace ods {
12 /**
13 * @brief Remote procedure call
15 * Instances of this class contains serialized data required
16 * to perform a rpc.
18 class rpc_call : public serialized_object {
19 virtual ~rpc_call() {}
22 /**
23 * @brief Functor
25 * @details Instances of this class carries all data needed
26 * to perform a procedure call invoked by the client. They are
27 * used to represent deserialized remote procedure calls.
29 class foreign_call {
30 public:
31 typedef unsigned int ret_val;
33 /**
34 * Invokes functor
36 * This member function invokes procedure call requested
37 * by the client.
39 virtual ret_val operator()() = 0;
42 /**
43 * @brief Call serializer
45 * @details This is a base class for all serializers able to
46 * marshall procedure invocation.
48 class call_serializer {
49 public:
50 /**
51 * Serialize procedure call
52 * @param mid method identifier
53 * @param stk part of stack coinatining invocation arguments
54 * @return marshalled, ready to sent, data
56 virtual p<rpc_call> serialize(ods_endpoint::method_id mid, ods_endpoint::stack stk) = 0;
58 /**
59 * Deserialize procedure call
60 * @param buf serialized procedure call
61 * @return functor performing rpc
63 virtual foreign_call deserialize(p<rpc_call> buf) = 0;
69 #endif