LoadBalancingTree.cc File Reference

#include "LoadBalancingTree.h"

Functions

std::ostream & operator<< (std::ostream &Stream, LoadBalancingTree t)


Function Documentation

std::ostream& operator<< ( std::ostream &  Stream,
LoadBalancingTree  t 
)

00648                                                                 {
00649         std::ostream& output = Stream << "Size: " << t.size << "readyIntermediateNodes " << t.readyIntermediateNodes.size() << "InReplace: " << t.inReplace.size() << " Freed: " << t.freed.size() << "\n\n";
00650         
00651         std::list<TreeNode*> queue;
00652         queue.push_back( t.root );
00653         std::list<TreeNode>::iterator ic;
00654         TreeNode* visit;
00655         int num= 0;
00656         int layer=0;
00657         while ( queue.size() > 0 ) {
00658                 visit = queue.front();
00659                 output << "NodeNum: " << num << " ChildSize: " << visit->childs.size() << " LeafSize: " << visit->leafs.size() << " NodeIp: " << visit->destip << " | ";
00660                 if( num % t.treeWidth == 0) output << " ### ";
00661                 if( num == pow(t.treeWidth, layer)  || num == 0 ) {
00662                         output << "\n\n";
00663                         layer++;
00664                 }
00665                 num++;
00666 
00667                 for( ic = visit->childs.begin(); ic != visit->childs.end(); ++ic) {
00668                         queue.push_back( &(*ic) );
00669                 }
00670                 queue.pop_front();
00671         }               
00672         return output;
00673 }


Generated on Tue Jul 24 16:51:17 2007 for ITM OverSim by  doxygen 1.5.1