[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using structures in octave C++ DLD functions
From: |
Federico Zenith |
Subject: |
Using structures in octave C++ DLD functions |
Date: |
Wed, 30 Jun 2004 12:18:54 +0200 |
User-agent: |
KMail/1.6.2 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I am working on a C++ DLD function, and I would find it practical to use
structures. I have not found on the Wiki how structures are handled in C++
when writing for Octave.
For istance, a very simple function that would extract the "a" element out of
structure "foo" would be (I expected):
- ----------------------
#include <octave/oct.h>
DEFUN_DLD(stru, args, , "foo.a extractor.")
{
return octave_value( args(0).a );
}
- ---------------------
with foo.a=1, foo.b=2, foo.c=3, I would expect stru(foo) to return 1.
However, this code gives me a compile error:
stru.cc:5: error: 'class octave_value' has no member named 'a'
So, how do I operate with structures from Octave? How are they passed to C++?
- -Federico
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA4pORcbPv7l8OLpsRAhuFAJ9ffWxEaopDIIpi+6RIujXgAWlCTACgmqXs
l0imWWlc4HzzT5Z2/ru+maQ=
=bu+V
-----END PGP SIGNATURE-----
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Using structures in octave C++ DLD functions,
Federico Zenith <=