43 indicies_(iOther.indicies_),
48 cachedItems_.store(
new std::vector<void const*>(*cache));
74 (*cachedItems_).reserve(
indicies_.capacity());
77 if(tmpCachedItems and (
indicies_.size() == (*tmpCachedItems).size())) {
79 tmpCachedItems->push_back(iData);
81 tmpCachedItems->push_back(
nullptr);
83 delete tmpCachedItems;
102 for(
auto ptr : *tmpCachedItems) {
123 if(
nullptr == tmpProductGetter) {
128 auto tmpCachedItems = std::make_unique<std::vector<void const*>>();
130 if(product !=
nullptr) {
133 std::vector<void const*>* expected =
nullptr;
134 if(
cachedItems_.compare_exchange_strong(expected, tmpCachedItems.get())) {
136 tmpCachedItems.release();
142 tmpCachedItems->resize(
indicies_.size(),
nullptr);
144 std::vector<unsigned int> thinnedKeys;
146 std::vector<WrapperBase const*> wrappers(
indicies_.size(),
nullptr);
147 tmpProductGetter->getThinnedProducts(
id(), wrappers, thinnedKeys);
148 unsigned int nWrappers = wrappers.size();
150 assert(wrappers.size() == tmpCachedItems->size());
151 for(
unsigned k = 0;
k < nWrappers; ++
k) {
152 if (wrappers[
k] !=
nullptr) {
153 wrappers[
k]->setPtr(
typeInfo(), thinnedKeys[
k], (*tmpCachedItems)[k]);
157 std::vector<void const*>* expected =
nullptr;
158 if(
cachedItems_.compare_exchange_strong(expected, tmpCachedItems.get())) {
160 tmpCachedItems.release();
168 if(not
tmp) {
return false;}
169 for(
auto item : *tmp) {
170 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