33 #ifndef CXVIEWCACHE_H_
34 #define CXVIEWCACHE_H_
36 #include "cxResourceVisualizationExport.h"
63 template<
class VIEW_TYPE>
68 mCentralWidget(widget), mNameGenerator(0), mTypeText(typeText)
77 QString uid = QString(
"%1-%2-%3")
79 .arg(mNameGenerator++)
80 .arg(reinterpret_cast<long>(
this));
81 VIEW_TYPE* view =
new VIEW_TYPE(uid, uid, mCentralWidget);
82 mCached.push_back(view);
85 VIEW_TYPE* retval = mCached.back();
87 mUsed.push_back(retval);
95 std::copy(mUsed.begin(), mUsed.end(), back_inserter(mCached));
99 QWidget* mCentralWidget;
102 std::vector<VIEW_TYPE*> mCached;
103 std::vector<VIEW_TYPE*> mUsed;
VIEW_TYPE * retrieveView()
ViewCache(QWidget *widget, QString typeText)