Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [MANTA] Unregister a callback?


Chronological Thread 
  • From: Abe Stephens <abe@sci.utah.edu>
  • To: Christiaan Paul Gribble <cgribble@sci.utah.edu>
  • Cc: manta@sci.utah.edu
  • Subject: Re: [MANTA] Unregister a callback?
  • Date: Wed, 16 Aug 2006 09:56:17 -0700

This functionality seems reasonable. Let's add a typedef'ed iterator type to MantaInterface and then return that from the add methods. Then we can pass an object of this type to the remove method.

Abe

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.

Top of page