Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] Re: Re: Re: Transaction Callbacks and function calling conventions


Chronological Thread 
  • From: "James Bigler" < >
  • To:
  • Subject: [Manta] Re: Re: Re: Transaction Callbacks and function calling conventions
  • Date: Mon, 15 Dec 2008 14:07:54 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=rYKKWhS3iSQbLL8Et2Soi3aa0Jiv8RLYwIKP02XTnmW3HIJO4022EoPKHd6j3+M2tV KBpHSKL+001bc9OC1m0mPaBRKvAfBC+45qiLk69YZRGAl9xiGu9KvpDUPb9UXOlaMMkv P2b9sT30TAhgw4ejN9sPtvOjFSKlMz5O0sD94=

On Mon, Dec 15, 2008 at 1:53 PM, Abe Stephens < "> > wrote:

On Dec 15, 2008, at 1:45 PM, Abe Stephens wrote:


template<class T, class Op>
void addTransaction(const char* name, TValue<T>& value, Op op, int flag = TransactionBase::DEFAULT );

Instead of adding a "TransactionBase" this method adds a "Transaction" which doesn't contain a callback. (So the apply method has nothing to delete.)

My guess is that this particular method is a long-depreciated implementation which predated the ultra-templated Callback classes, using the "Op" parameter instead.

Does anyone know for sure?

Abe

This is a little used facility of the callback mechanisms.  The idea is that you have a value (TValue) you want to change.  Rather than write a callback function for every value you want to change, you make those values TValues.  You then pass the TValue along with the kind of operation you want to do (increment, decrement, etc.).  There is an example of this that changes the number of processors in XWindow.  The hope was that you could reuse the operations on many different TValues, increasing code reuse.  However, in practice many of the callbacks wished to do some kind of error checking and the classes of operator functions would have bollooned.  We started writing more callback functions than TValue/Op functions.

James




Archive powered by MHonArc 2.6.16.

Top of page