33 #ifndef CXVIEWCACHE_H_
34 #define CXVIEWCACHE_H_
36 #include "cxResourceVisualizationExport.h"
64 template<
class VIEW_TYPE>
69 mCentralWidget(widget), mNameGenerator(0), mTypeText(typeText)
78 QString uid = QString(
"%1-%2-%3")
80 .arg(mNameGenerator++)
81 .arg(reinterpret_cast<long>(
this));
82 VIEW_TYPE* view =
new VIEW_TYPE(uid, uid, mCentralWidget);
83 mCached.push_back(view);
86 VIEW_TYPE* retval = mCached.back();
88 mUsed.push_back(retval);
96 std::copy(mUsed.begin(), mUsed.end(), back_inserter(mCached));
100 QWidget* mCentralWidget;
103 std::vector<VIEW_TYPE*> mCached;
104 std::vector<VIEW_TYPE*> mUsed;
VIEW_TYPE * retrieveView()
ViewCache(QWidget *widget, QString typeText)