www.pudn.com > Product_Submit2004.rar > BRCRegion.cc, change:2004-04-22,size:778b


#include <OPENR/OPENRAPI.h> 
#include <OPENR/OObject.h> 
#include <OPENR/OSubject.h> 
#include <OPENR/OObserver.h>  
 
#include "BRCRegion.h" 
#include "Common.h" 
 
 
BRCRegion::BRCRegion()  
{ 
} 
 
BRCRegion::BRCRegion(int numBufferedRegions, int size) { 
  numBufferedRegions_ = numBufferedRegions; 
 
  bufferedRegions_ = new RCRegion*[numBufferedRegions_]; 
 
  for (int i = 0; i < numBufferedRegions_; i++) { 
    bufferedRegions_[i] = new RCRegion(size); 
  } 
} 
 
int BRCRegion::GetFreeRegionIndex() { 
  int c = -1; 
  for (int i = 0; i < numBufferedRegions_; i++) { 
    if (bufferedRegions_[i]->NumberOfReference() > 1) { 
      continue; 
    } 
    c = i; 
  } 
  return c; 
} 
 
RCRegion* BRCRegion::GetRegion(int index) { 
  return bufferedRegions_[index]; 
}