AQP学习笔记(一)


Chapter 1: Hybrid Desktop/Internet Applications

With a implement of a weather app to introduce it.
within it,I see a template class "QCache".
In fact it use the qHash to store data and afford quick search. In the Qt4.7.2's doc It says:
The advantage of using QCache over some other key-based data structure (such as QMap or QHash) is that QCache automatically takes ownership of the objects that are inserted into the cache and deletes them to make room for new objects, if necessary. When inserting an object into the cache, you can specify a cost, which should bear some approximate relationship to the amount of memory taken by the object. When the sum of all objects' costs (totalCost()) exceeds the cache's limit (maxCost()), QCache starts deleting objects in the cache to keep under the limit, starting with less recently accessed objects.
总的来说呢,就是这个QCache类可以自动管理里面的数据.切删除放不下的chache的时候回首先从最少使用的那些数据开始删除...很自动化的一个东西.

今天花了点时间看完了第一章.找个时间一起总结一下
这几天花了大量的时间看完了前几章..真的写得不错..但是隐隐约约感觉有点问题...唉~





comments powered by Disqus