12 #ifndef CXVIEWCACHE_H_
13 #define CXVIEWCACHE_H_
15 #include "cxResourceVisualizationExport.h"
45 template<
class VIEW_TYPE>
50 mRenderWindowFactory(factory),
51 mCentralWidget(widget),
62 QString uid = QString(
"%1-%2-%3")
64 .arg(mNameGenerator++)
65 .arg(
reinterpret_cast<long>(
this));
66 VIEW_TYPE* view =
new VIEW_TYPE(mRenderWindowFactory, uid, uid, mCentralWidget);
67 mCached.push_back(view);
70 VIEW_TYPE* retval = mCached.back();
72 mUsed.push_back(retval);
80 std::copy(mUsed.begin(), mUsed.end(), back_inserter(mCached));
93 QWidget* mCentralWidget;
96 std::vector<VIEW_TYPE*> mCached;
97 std::vector<VIEW_TYPE*> mUsed;