49 cachedItems_.store(
new std::vector<void const*>(*cache));
75 (*cachedItems_).reserve(
indicies_.capacity());
78 if(tmpCachedItems and (
indicies_.size() == (*tmpCachedItems).size())) {
80 tmpCachedItems->push_back(iData);
82 tmpCachedItems->push_back(
nullptr);
84 delete tmpCachedItems;
103 for(
auto ptr : *tmpCachedItems) {
124 if(
nullptr == tmpProductGetter) {
129 auto tmpCachedItems = std::make_unique<std::vector<void const*>>();
131 if(product !=
nullptr) {
134 std::vector<void const*>* expected =
nullptr;
135 if(
cachedItems_.compare_exchange_strong(expected, tmpCachedItems.get())) {
137 tmpCachedItems.release();
143 tmpCachedItems->resize(
indicies_.size(),
nullptr);
145 std::vector<unsigned int> thinnedKeys;
147 std::vector<WrapperBase const*> wrappers(
indicies_.size(),
nullptr);
148 tmpProductGetter->getThinnedProducts(
id(), wrappers, thinnedKeys);
149 unsigned int nWrappers = wrappers.size();
150 assert(wrappers.size() ==
indicies_.size());
151 assert(wrappers.size() == tmpCachedItems->size());
152 for(
unsigned k = 0;
k < nWrappers; ++
k) {
153 if (wrappers[
k] !=
nullptr) {
154 wrappers[
k]->setPtr(
typeInfo(), thinnedKeys[
k], (*tmpCachedItems)[k]);
158 std::vector<void const*>* expected =
nullptr;
159 if(
cachedItems_.compare_exchange_strong(expected, tmpCachedItems.get())) {
161 tmpCachedItems.release();
169 if(not
tmp) {
return false;}
170 for(
auto item : *tmp) {
171 if(item ==
nullptr) {
void push_back_base(RefCore const &core, key_type iKey, void const *iData)
void pushBackItem(RefCore const &productToBeInserted, bool checkPointer)
bool checkCachedItems() const
void swap(RefCore &) noexcept
void swap(PtrVectorBase &other)
swap
static const std::vector< void const * > s_emptyCache
virtual std::type_info const & typeInfo() const
bool equal(const T &first, const T &second)
static const std::vector< void const * > & emptyCache()
ProductID id() const
Accessor for product ID.
std::vector< key_type > indicies_
std::atomic< std::vector< void const * > * > cachedItems_
bool operator==(PtrVectorBase const &iRHS) const
void fillPtrVector(std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr) const
std::vector< std::vector< double > > tmp
EDProductGetter const * productGetter() const
Accessor for product getter.
void const * product() const