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
33#pragma GCC visibility push(default)
34namespace abacus {
35
36
37template <class BaseType, class CoType>
38std::ostream &operator<<(std::ostream &out, const PoolSlotRef<BaseType, CoType> &slot)
39{
40 if (slot.conVar())
41 slot.conVar()->print(out);
42 return out;
43}
44
45
46template<class BaseType, class CoType>
48{
49 Logger::ilout(Logger::Level::Minor) << "PoolSlotRef::con: Version of reference to slot " << version_
50 << " and version of slot " << slot_->version() << " differ." << std::endl;
51}
52
53
54template<class BaseType, class CoType>
55void PoolSlotRef<BaseType, CoType>::slot(PoolSlot<BaseType, CoType> *s)
56{
57 ConVar *cv;
58
59 if(slot_) {
60 cv = slot_->conVar();
61 if (cv && version_ == slot_->version())
62 cv->removeReference();
63 }
64
65 slot_ = s;
66 version_ = s->version();
67 cv = slot_->conVar();
68 if(cv) cv->addReference();
69}
70
71}
72#pragma GCC visibility pop
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:213
std::ostream & operator<<(std::ostream &out, const Active< BaseType, CoType > &rhs)
poolslotref