#include <HxImageRepManager.h>
Inheritance diagram for HxImageRepManager::
Public Methods | |
HxImageRepManager () | |
virtual | ~HxImageRepManager () |
virtual void | setTotalLimit (HxString unit, int value) |
Set limit on given unit. More... | |
virtual int | getTotalLimit (HxString unit) |
virtual void | setObjectLimit (HxString unit, int value) |
Set limit (per object) on given unit. More... | |
virtual int | getObjectLimit (HxString unit) |
virtual int | getUsed (HxString unit) |
virtual void | getUnitList (HxStringListBackInserter slPtr) |
List unit names that this manager can handle. More... | |
Protected Types | |
typedef HxDefaultObjectInfo | HxImageRepInfo_base |
Protected Methods | |
virtual HxDefaultObjectInfo * | createObjectInfo () |
Factory function that creates objectInfos. More... | |
virtual void | setObjectInfo (PortableServer::Servant servant, HxDefaultObjectInfo *info) |
Function called by "objectCreated". More... | |
virtual void | updateObjectInfo (PortableServer::Servant servant, HxDefaultObjectInfo *info) |
Function called by "objectUsed". More... | |
virtual void | removeObjectInfo (HxDefaultObjectInfo *info) |
virtual bool | objectExceedsLimit (HxDefaultObjectInfo *info) |
virtual bool | objectCanGrow () |
virtual bool | limitExceeded () |
Protected Attributes | |
int | _usedRows |
int | _totalRowLimit |
int | _imageRowLimit |
int | _usedCols |
int | _totalColLimit |
int | _imageColLimit |
|
|
|
00020 : HxDefaultDataObjectManager("IDL:HxCorba/ImageRep:1.0", "Images"), 00021 _totalRowLimit(-1), _imageRowLimit(-1), _usedRows(0), 00022 _totalColLimit(-1), _imageColLimit(-1), _usedCols(0) 00023 { 00024 } |
|
00028 { 00029 } |
|
Set limit on given unit. All objects together don't have to exceed that limit. Reimplemented from HxDefaultDataObjectManager.
00121 { 00122 if(unit == ROWS_UNIT) _totalRowLimit = value; 00123 else if(unit == COLS_UNIT) _totalColLimit = value; 00124 HxDefaultDataObjectManager::setTotalLimit(unit, value); 00125 } |
|
Reimplemented from HxDefaultDataObjectManager.
00129 { 00130 if(unit == ROWS_UNIT) return _totalRowLimit; 00131 else if(unit == COLS_UNIT) return _totalColLimit; 00132 else return HxDefaultDataObjectManager::getTotalLimit(unit); 00133 } |
|
Set limit (per object) on given unit. Any object can exceed that limit. Reimplemented from HxDefaultDataObjectManager.
00105 { 00106 if(unit == ROWS_UNIT) _imageRowLimit = value; 00107 else if(unit == COLS_UNIT) _imageColLimit = value; 00108 HxDefaultDataObjectManager::setObjectLimit(unit, value); 00109 } |
|
Reimplemented from HxDefaultDataObjectManager.
00113 { 00114 if(unit == ROWS_UNIT) return _imageRowLimit; 00115 else if(unit == COLS_UNIT) return _imageColLimit; 00116 else return HxDefaultDataObjectManager::getObjectLimit(unit); 00117 } |
|
Reimplemented from HxDefaultDataObjectManager.
00137 { 00138 if(unit == ROWS_UNIT) return _usedRows; 00139 else if(unit == COLS_UNIT) return _usedCols; 00140 else return HxDefaultDataObjectManager::getUsed(unit); 00141 } |
|
List unit names that this manager can handle.
Reimplemented from HxDefaultDataObjectManager.
00097 { 00098 HxDefaultDataObjectManager::getUnitList(slPtr); 00099 *slPtr++ = ROWS_UNIT; 00100 *slPtr++ = COLS_UNIT; 00101 } |
|
Factory function that creates objectInfos.
Reimplemented from HxDefaultDataObjectManager.
00033 { 00034 return new HxImageRepInfo(); 00035 } |
|
Function called by "objectCreated". Write object info on struct and update limits. Reimplemented from HxDefaultDataObjectManager.
00040 { 00041 HxDefaultDataObjectManager::setObjectInfo(servant, info); 00042 00043 HxImageRepInfo* imageInfo = static_cast<HxImageRepInfo*>(info); 00044 00045 HxImageRepTiedSvt::TieT* tie = dynamic_cast<HxImageRepTiedSvt::TieT*>(servant); 00046 HxImageRep* img = tie->_tied_object(); 00047 00048 imageInfo->nCols = img->dimensionSize(1); 00049 imageInfo->nRows = img->dimensionSize(2); 00050 00051 _usedRows += imageInfo->nRows; 00052 _usedCols += imageInfo->nCols; 00053 } |
|
Function called by "objectUsed". Write object info on struct (in case that the object has been modified) and update limits. Reimplemented from HxDefaultDataObjectManager.
00057 { 00058 HxDefaultDataObjectManager::updateObjectInfo(servant, info); 00059 00060 // images can not grow: do nothing. 00061 } |
|
Reimplemented from HxDefaultDataObjectManager.
00065 { 00066 HxImageRepInfo* imageInfo = static_cast<HxImageRepInfo*>(info); 00067 _usedRows -= imageInfo->nRows; 00068 _usedCols -= imageInfo->nCols; 00069 00070 HxDefaultDataObjectManager::removeObjectInfo(info); 00071 } |
|
Reimplemented from HxDefaultDataObjectManager.
00075 { 00076 HxImageRepInfo* imageInfo = static_cast<HxImageRepInfo*>(info); 00077 return ((_imageRowLimit >= 0) && (imageInfo->nRows > _imageRowLimit)) 00078 || ((_imageColLimit >= 0) && (imageInfo->nCols > _imageColLimit)); 00079 } |
|
Reimplemented from HxDefaultDataObjectManager.
00083 { 00084 return false; 00085 } |
|
Reimplemented from HxDefaultDataObjectManager.
00089 { 00090 return HxDefaultDataObjectManager::limitExceeded() || 00091 ((_totalRowLimit >= 0) && (_usedRows > _totalRowLimit)) || 00092 ((_totalColLimit >= 0) && (_usedCols > _totalColLimit)); 00093 } |
|
|
|
|
|
|
|
|
|
|
|
|