19 auto pWeakGroup = std::weak_ptr<SparklineGroup>(pSparkline->getSparklineGroup());
21 auto[iterator, bInserted]
23 iterator->second.push_back(std::weak_ptr<Sparkline>(pSparkline));
30 auto pWeakGroup = std::weak_ptr<SparklineGroup>(pSparkline->getSparklineGroup());
34 auto& rWeakSparklines = iteratorGroup->second;
36 for (
auto iterator = rWeakSparklines.begin(); iterator != rWeakSparklines.end();)
38 auto pCurrentSparkline = iterator->lock();
40 if (pCurrentSparkline && pCurrentSparkline != pSparkline)
46 iterator = rWeakSparklines.erase(iterator);
54 std::vector<std::shared_ptr<SparklineGroup>> toReturn;
58 auto pWeakGroup = *iterator;
59 if (
auto pSparklineGroup = pWeakGroup.lock())
61 toReturn.push_back(pSparklineGroup);
72std::vector<std::shared_ptr<Sparkline>>
75 std::vector<std::shared_ptr<Sparkline>> toReturn;
77 std::weak_ptr<SparklineGroup> pWeakGroup(pSparklineGroup);
83 auto& rWeakSparklines = iteratorGroup->second;
85 for (
auto iterator = rWeakSparklines.begin(); iterator != rWeakSparklines.end();)
87 if (
auto aSparkline = iterator->lock())
89 toReturn.push_back(aSparkline);
94 iterator = rWeakSparklines.erase(iterator);
std::vector< std::weak_ptr< SparklineGroup > > m_aSparklineGroups
void removeSparkline(std::shared_ptr< Sparkline > const &pSparkline)
void addSparkline(std::shared_ptr< Sparkline > const &pSparkline)
std::map< std::weak_ptr< SparklineGroup >, std::vector< std::weak_ptr< Sparkline > >, std::owner_less<> > m_aSparklineGroupMap
std::vector< std::shared_ptr< Sparkline > > getSparklinesFor(std::shared_ptr< SparklineGroup > const &pSparklineGroup)
std::vector< std::shared_ptr< SparklineGroup > > getSparklineGroups()
CAUTION! The following defines must be in the same namespace as the respective type.