/*! Gets a memory size for limited mode (Mb). */
float GetLimitedMemory();
+ /*!
+ * Gets an expended memory size for the cache system (Mb).
+ */
+ float GetMemorySize();
+
/*! Creates %ColoredPrs3dHolder.*/
ColoredPrs3dHolder CreateHolder(in VISUType theType,
in ColoredPrs3dHolder::BasicInput theInput);
}
+//----------------------------------------------------------------------------
+CORBA::Float
+VISU::ColoredPrs3dCache_i
+::GetMemorySize()
+{
+ CORBA::Float aMemoryUsed = 0.0;
+ TColoredPrs3dHolderMap::const_iterator aHolderIter = myHolderMap.begin();
+ TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = myHolderMap.end();
+ for(; aHolderIter != aHolderIterEnd; aHolderIter++){
+ const TLastVisitedPrsList& aPrsList = aHolderIter->second;
+ TLastVisitedPrsList::const_iterator aPrsIter = aPrsList.begin();
+ TLastVisitedPrsList::const_iterator aPrsIterEnd = aPrsList.end();
+ for(; aPrsIter != aPrsIterEnd; aPrsIter++){
+ if(VISU::ColoredPrs3d_i* aPrs3d = *aPrsIter)
+ aMemoryUsed += aPrs3d->GetMemorySize();
+ }
+ }
+ return aMemoryUsed;
+}
+
+
//----------------------------------------------------------------------------
template<unsigned int colored_prs3d_type_enum>
size_t
}
if(aMemory > 0){
if(GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED){
- float aMemoryUsed = 0;
- TColoredPrs3dHolderMap::const_iterator aHolderIter = myHolderMap.begin();
- TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = myHolderMap.end();
- for(; aHolderIter != aHolderIterEnd; aHolderIter++){
- const TLastVisitedPrsList& aPrsList = aHolderIter->second;
- TLastVisitedPrsList::const_iterator aPrsIter = aPrsList.begin();
- TLastVisitedPrsList::const_iterator aPrsIterEnd = aPrsList.end();
- for(; aPrsIter != aPrsIterEnd; aPrsIter++){
- if(VISU::ColoredPrs3d_i* aPrs3d = *aPrsIter)
- aMemoryUsed += aPrs3d->GetMemorySize();
- }
- }
- float aMemoryNeeded = (float)(aMemory / (1024.0 * 1024.0)); // convert to Mb
- float aMemoryLimit = GetLimitedMemory();
-
+ CORBA::Float aMemoryUsed = GetMemorySize();
+ CORBA::Float aMemoryLimit = GetLimitedMemory();
+ CORBA::Float aMemoryNeeded = CORBA::Float(aMemory/(1024.0*1024.0)); // convert to Mb
//cout<<"Memory needed: "<<aMemoryNeeded<<"; used: "<<aMemoryUsed<<"; limit: "<<aMemoryLimit<<endl;
return aMemoryUsed + aMemoryNeeded < aMemoryLimit;
}