开发者

Parameter marshaling protocol homework for RPC call?

I have a homework to build on paper a parameter marshaling protocol to be suited to call a method with one variable, or with an array (like a polymorphism).

procedure(var1)

procedure(arra开发者_运维技巧y1)

How would you define the protocol? How about the method in C++


You could try to make the functions with Object parameters. i.e

void myFunction(void* param, int paramType) { if(paramType == definedTypes[0] ) { // do stuff } else if(paramType == definedTypes[1]) { //do something else } }

you pass 2 parameters: in the first your object, in the second the type of your object, you have to define for example in an array what types of data are you interested in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜