Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

poolslotref.inc
Go to the documentation of this file.
1 
29 #pragma once
30 
32 
33 namespace abacus {
34 
35 
36 template <class BaseType, class CoType>
37 std::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 
45 template<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 
53 template<class BaseType, class CoType>
54 void PoolSlotRef<BaseType, CoType>::slot(PoolSlot<BaseType, CoType> *s)
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 }
ogdf::Logger::Level::Minor
@ Minor
abacus::operator<<
std::ostream & operator<<(std::ostream &out, const Active< BaseType, CoType > &rhs)
abacus
Definition: ILPClusterPlanarity.h:50
poolslotref.h
poolslotref
ogdf::Logger::ilout
static std::ostream & ilout(Level level=Level::Default)
Definition: Logger.h:213
abacus::PoolSlotRef::printDifferentVersionError
void printDifferentVersionError() const
abacus::PoolSlotRef::slot
PoolSlot< BaseType, CoType > * slot() const
Returns a pointer to the referenced slot.
Definition: poolslotref.h:139