[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about sharing data structure in octave
From: |
Michael Goffioul |
Subject: |
Re: Question about sharing data structure in octave |
Date: |
Mon, 30 Jun 2008 10:29:14 +0200 |
On Sat, Jun 28, 2008 at 10:54 AM, John W. Eaton <address@hidden> wrote:
> I'm not sure I understand precisely what it is you want to do, but
> since the reference counting is managed in the octave_value class, why
> not add a field that says what the copying policy should be, then use
> that in the functions that manipulate the reference count? Would that
> work for what you want to do?
My goal is to implement listeners using separate self-contained
objects. However, I need these objects to act as pointers (== handle
class in octave), in order to keep track of the listener state. For
instance:
h1 = addlistener(...)
h2 = h1;
h2.Enabled = false;
disp(h1.Enabled); % should print "false"
I don't want h1 and h2 to be 2 separate objects, but I want them to
"refer" to the same internal listener representation. I'm then
wondering if I can directly use octave_base_value to do that;
I'm not sure when octave_value clones its internal rep.
Michael.