Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r934 - trunk/fox/afr_demo/Engine/Control


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r934 - trunk/fox/afr_demo/Engine/Control
  • Date: Sun, 12 Feb 2006 22:37:12 -0700 (MST)

Author: abe
Date: Sun Feb 12 22:37:12 2006
New Revision: 934

Modified:
   trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
   trunk/fox/afr_demo/Engine/Control/AFRPipeline.h
Log:

Moved RTRT.cc transaction changes into the AFRPipeline

M    fox/afr_demo/Engine/Control/AFRPipeline.cc
M    fox/afr_demo/Engine/Control/AFRPipeline.h


Modified: trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc    (original)
+++ trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc    Sun Feb 12 22:37:12 
2006
@@ -752,32 +752,50 @@
     (*iter)->call(proc, numProcs, changed);
 }
 
+///////////////////////////////////////////////////////////////////////////////
+// POST TRANSACTIONS  
+///////////////////////////////////////////////////////////////////////////////
 void AFRPipeline::postTransactions(bool& changed)
 {
   if(transactions.size() > 0){
+
+    // Lock the queue.
     transaction_lock.lock();
     changed = true;
-    for(TransactionListType::iterator iter = transactions.begin();
- iter != transactions.end(); iter++){
-      TransactionBase* transaction = *iter;
-      if(verbose_transactions){
- cerr << "Apply transaction: " << transaction->getName() << " : ";
- transaction->printValue(cerr);
- cerr << " : ";
- transaction->printOp(cerr);
- cerr << " : ";
-      }
+
+    int flag = 0;
+    while (transactions.size()) {
+      // Pop the first transaction from the queue.
+      TransactionBase *transaction = *(transactions.begin());
+      transactions.pop_front();
+
+      // Apply the transaction.
       transaction->apply();
-      if(verbose_transactions){
- transaction->printValue(cerr);
- cerr << '\n';
-      }
+      int flag = transaction->getFlag();
+
+      // Delete the transaction.
       delete transaction;
+
+      // Determine if the transaction contains any queue operations.
+      if (flag == TransactionBase::CONTINUE) {
+        // Stop processing transactions and continue the pipeline.
+        break;
+      }
+      else if (flag == TransactionBase::PURGE) {
+        // Remove all remaining transactions from the queue.
+        while (transactions.size()) {
+          transaction = *(transactions.begin());
+          transactions.pop_front();
+          delete transaction;
+        }
+      }
     }
-    transactions.resize(0);
+
+    // Unlock the queue.
     transaction_lock.unlock();
   }
 }
+
 
 void AFRPipeline::doParallelPreRenderCallbacks(int proc, int numProcs)
 {

Modified: trunk/fox/afr_demo/Engine/Control/AFRPipeline.h
==============================================================================
--- trunk/fox/afr_demo/Engine/Control/AFRPipeline.h     (original)
+++ trunk/fox/afr_demo/Engine/Control/AFRPipeline.h     Sun Feb 12 22:37:12 
2006
@@ -45,6 +45,7 @@
 #include <map>
 #include <set>
 #include <vector>
+#include <list>
 
 #include <Engine/ImageTraversers/AFRImageTraverser.h>
 
@@ -255,7 +256,7 @@
       vector<SetupCallback*> setupCallbacks;
 
       // Transactions
-      typedef vector<TransactionBase*> TransactionListType;
+      typedef list<TransactionBase*> TransactionListType;
       TransactionListType transactions;
       SCIRun::Mutex transaction_lock;
       void postTransactions(bool& changed);




  • [MANTA] r934 - trunk/fox/afr_demo/Engine/Control, abe, 02/12/2006

Archive powered by MHonArc 2.6.16.

Top of page