几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】paging suppor (http://www.dimcax.com/hust/showthread.php?t=17833)

yang686526 2009-05-06 09:35 PM

【转帖】paging suppor
 
paging support
paging support

the "paging support" described in the dwgdirect help file.
to quote from the help file :
" for environments with limited heap space, dwgdirect contains 2 options that can be used to reduce overall heap demands during a file loading: "
my question is - how can use the "paging support" ?
dwgdirect help file describes using of "paging support":
quote:
while partial loading is ideal for some applications, it does not significantly affect resource requirements if an application requires access to most or all objects in a database (because the end result is that all objects are loaded into heap memory, just like a full load).
for environments with limited heap space, dwgdirect contains 2 options that can be used to reduce overall heap demands during a file loading:
unloading of database objects in a partially opened database, as the objects are closed. in this scheme, a user performs a partial load of a dwg file. then when a specific object is opened, it is loaded from the file (normal partial load behavior). however, when the object is closed, it is added to an "unload queue", and it will be unloaded from memory during the next call to oddbpageobjects. this allows the total number of objects that are held in heap memory at any one time, to be controlled by the client application. this option is useful in situations where the majority of database objects need to opened one time only (such as during the import of an oddbdatabase into a third-party application). this option can be enabled by setting the kunload flag on the return value of the client's oddbpagecontroller:: pagingtype override (see below). only objects that have not been modified can be unloaded.
paging of objects to temporary storage, as they are closed. this paging applies to any database object (modified or unmodified) in any database (it is not limited to databases created by partially loading a file). as with the kunload case, actual paging does not occur until the client application calls oddbpageobjects. the temporary storage device is determined by the client overrides of the oddbpagecontroller::read and oddbpagecontroller::write functions. this option can be enabled by setting the kpage flag on the return value of the client's oddbpagecontroller:: pagingtype override (see below).
if unloading and paging are enabled simultaneously, then unloading applies first to unmodified objects from a partially opened database, as the objects are closed. modified objects, and objects from a fully loaded database, are paged when they are closed (as unloading is not applicable in these situations).
the following steps must be performed to implement either of these strategies:
create a custom class derived from oddbpagecontroller, overriding the necessary functions to enable the desired type of paging.
return an instance of this custom page controller from a client override of oddbhostappservices::newpagecontroller.
call oddbpageobjects to invoke a paging operation.
see the expagecontroller.cpp file in examples/exservices, for a sample implementation of unloading and paging classes. odamfcapp demonstrates how to use these sample classes.
enabling paging support can significantly reduce the overall heap requirements of a dwgdirect application.
could you define the question more exactly?
regards,
sergey vishnevetsky


所有的时间均为北京时间。 现在的时间是 07:50 AM.