0

is there inout argument type?

asked 2015-02-26 19:17:54 -0800

langsir gravatar image

I only found in or out argument, but no inout type? anybody knows that?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-02 10:15:41 -0800

stevek gravatar image

Short answer: No, there are no in/out parameters for AllJoyn.

Long answer: AllJoyn is effectively an RPC mechanism. This means that all "parameters" get serialized into a data stream that is delivered over a network connection. This makes in/out parameters impossible.

If you are thinking of in/out parameters like C++'s reference parameters to a function, then under the hood, those are really just in parameters that are pointers to modifiable memory. C++ syntax just hides that fact. With AllJoyn, since the data is delivered over a network connection it is not possible for the recipient to directly modify the sender's memory in the same way that C++ function can modify the memory of its caller.

edit flag offensive delete publish link more

Comments

There are in and out parameters, but no inout parameters. In the synchronized method call of RPC, the recipient of course can 'modify' the memory of the caller by means of Proxy in the local memory.

langsir ( 2015-03-04 23:23:24 -0800 )edit

In AllJoyn, the callee does not have a proxy of the caller. If it did, you would have very severe distributed state problems. For starters the caller would not get the out value of an in/out parameter. As I tried to explain, an in/out parameter is really just a conceptual model in some languages that is really just a memory reference that the callee can modify. All out parameters must be serialized in a specific order so that the callee knows which values are which.

stevek ( 2015-03-06 08:55:36 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-02-26 19:17:54 -0800

Seen: 38 times

Last updated: Mar 02 '15