40 : core_(iOther.core_), indicies_(iOther.indicies_), cachedItems_(nullptr) {
67 (*cachedItems_).reserve(
indicies_.capacity());
70 if (tmpCachedItems and (
indicies_.size() == (*tmpCachedItems).size())) {
72 tmpCachedItems->push_back(iData);
74 tmpCachedItems->push_back(
nullptr);
76 delete tmpCachedItems;
94 for (
auto ptr : *tmpCachedItems) {
114 if (
nullptr == tmpProductGetter) {
119 auto tmpCachedItems = std::make_unique<std::vector<void const*>>();
124 std::vector<void const*>* expected =
nullptr;
125 if (
cachedItems_.compare_exchange_strong(expected, tmpCachedItems.get())) {
127 tmpCachedItems.release();
133 tmpCachedItems->resize(
indicies_.size(),
nullptr);
135 std::vector<unsigned int> thinnedKeys;
137 std::vector<WrapperBase const*> wrappers(
indicies_.size(),
nullptr);
138 tmpProductGetter->getThinnedProducts(
id(), wrappers, thinnedKeys);
139 unsigned int nWrappers = wrappers.size();
141 assert(wrappers.size() == tmpCachedItems->size());
142 for (
unsigned k = 0;
k < nWrappers; ++
k) {
143 if (wrappers[
k] !=
nullptr) {
144 wrappers[
k]->setPtr(
typeInfo(), thinnedKeys[
k], (*tmpCachedItems)[
k]);
148 std::vector<void const*>* expected =
nullptr;
149 if (
cachedItems_.compare_exchange_strong(expected, tmpCachedItems.get())) {
151 tmpCachedItems.release();
162 if (
item ==
nullptr) {
164 <<
"Asked for data from a PtrVector which refers to a non-existent product with ProductID " <<
id() <<
"\n";