Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
poolslotref.inc
Go to the documentation of this file.
1
29#pragma once
30
32
33namespace abacus {
34
35
36template <class BaseType, class CoType>
37std::ostream &operator<<(std::ostream &out, const PoolSlotRef<BaseType, CoType> &slot)
38{
39 if (slot.conVar())
40 slot.conVar()->print(out);
41 return out;
42}
43
44
45template<class BaseType, class CoType>
47{
48 Logger::ilout(Logger::Level::Minor) << "PoolSlotRef::con: Version of reference to slot " << version_
49 << " and version of slot " << slot_->version() << " differ." << std::endl;
50}
51
52
53template<class BaseType, class CoType>
55{
56 ConVar *cv;
57
58 if(slot_) {
59 cv = slot_->conVar();
60 if (cv && version_ == slot_->version())
61 cv->removeReference();
62 }
63
64 slot_ = s;
65 version_ = s->version();
66 cv = slot_->conVar();
67 if(cv) cv->addReference();
68}
69
70}
void printDifferentVersionError() const
PoolSlot< BaseType, CoType > * slot() const
Returns a pointer to the referenced slot.
static std::ostream & ilout(Level level=Level::Default)
Definition Logger.h:187
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
std::ostream & operator<<(std::ostream &out, const Active< BaseType, CoType > &rhs)
poolslotref