help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loadlibrary... again


From: Jose
Subject: Re: loadlibrary... again
Date: Sat, 23 Nov 2013 16:20:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

Hello Marc.

On 11/23/2013 02:18 PM, marcimatz wrote:
Jose,

sorry for the delay to reply you.
Thanks a lot, this is actually exactly what I need to do.
Would you mind posting 1-2 functions of your mex-file, in order to get an
idea how to start?

I don't quite understand what you mean by 1-2 functions of your mex-file. So I will send you a complete mex file which hopefully will help you to get the idea.

This mex-file is the interface to a library which handles the subscriber part of a publisher/subscriber architecture (using ICE from ZeroC), plus many more things. I was handling the publisher in another mex file, so you will not see the publish method.

The usage from octave is

  Out=MsSubscriberAv_mex(handle,operation,arguments)

where:

 -handle: a handle to the objejct.
 -operation: a string specifying the method to call
 -arguments: arguments requited by the particular operation.

The output Out will depend on the operation.

For example:
-Create the object (the first thing you will have to do)
MsHandler=MsSubscriberAv_mex(0,"create",storage_size,0);
The output is obviously a handle (pointer) to the object.

- Call the subscribe method
MsSubscriberAv_mex(MsHandler,"subscribe");

- Get a measurement
sm=MsSubscriberAv_mex(MsHandler,"getSm");

I guess you get the idea. This is one way to do it, there are others. But this worked fine for me. Notice the functions create_handle, get_object and destroy object from the MEX ObjectHandle library that I mentioned to you in my previous mail. If you decide to try this way, remember to read the thread that I pointed out in my previous mail.

Good luck.

J.

Attachment: MsSubscriberAv_mex.cpp
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]