Text archives Help
- From: Andrew Kensler <aek@cs.utah.edu>
- To: "Steven G. Parker" <sparker@cs.utah.edu>
- Cc: Christiaan Paul Gribble <cgribble@sci.utah.edu>, manta@sci.utah.edu
- Subject: Re: [MANTA] Unregister a callback?
- Date: Wed, 16 Aug 2006 10:57:49 -0600 (MDT)
"vec.begin() + index" should do it.
- Andrew
On Wed, 16 Aug 2006, Steven G. Parker wrote:
>
You can get an iterator from an index I believe.
>
>
Steve
>
>
>
On Aug 16, 2006, at 10:52 AM, Christiaan Paul Gribble wrote:
>
>
> Too hasty. vector::erase takes an iterator, not an index.
>
>
>
> On Aug 16, 2006, at 10:39 AM, Christiaan Paul Gribble wrote:
>
>
>
> > It appears to me as if this functionality does not exist. I don't
>
> > believe it to be too hard, however. Here's what I'm thinking:
>
> >
>
> > Change register<Blah> to return a handle to the callback (its index
>
> > into the corresponding callback vector)
>
> > Keep that handle around for callbacks that will need unregistered at
>
> > some point (user's responsibility)
>
> > Add an unregister<Blah> function to erase the element indicated by
>
> > the handle, invoke it as a transaction
>
> >
>
> > It seems as though this would work, because the do<Blah> functions
>
> > first check the size, so if the unregister<Blah> happen at a safe
>
> > point (during transaction processing), this shouldn't be an issue,
>
> > right? Or am I missing something?
>
> >
>
> > Comments?
>
> >
>
> > C
>
> >
>
> > On Aug 16, 2006, at 10:14 AM, Christiaan Paul Gribble wrote:
>
> >
>
> > > Hi,
>
> > >
>
> > > Is there a way to unregister a callback? I only want it to
>
> > > execute under certain conditions (that tend to persist over a
>
> > > large number of frames), and when the termination criteria are
>
> > > reached, I'd like to unregister the callback. I could accomplish
>
> > > the same thing by having each frame that meets the criteria
>
> > > register a OneShot for the next frame, but that seems like a lot
>
> > > of overhead, given that the callback will persist for some time
>
> > > (e.g., over the course of a camera path).
>
> > >
>
> > > Ideas?
>
> > >
>
> > > C
>
> >
>
>
>
>
Archive powered by MHonArc 2.6.16.