28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 36 template <
template <
typename >
class ALLOC >
44 template <
template <
typename >
class ALLOC >
53 template <
template <
typename >
class ALLOC >
55 const ScoringCache< ALLOC >& from,
58 __scores(from.__scores) {
64 template <
template <
typename >
class ALLOC >
70 template <
template <
typename >
class ALLOC >
72 ScoringCache< ALLOC >&& from,
75 __scores(
std::move(from.__scores)) {
81 template <
template <
typename >
class ALLOC >
87 template <
template <
typename >
class ALLOC >
90 ALLOC< ScoringCache< ALLOC > > allocator(alloc);
91 ScoringCache< ALLOC >* cache = allocator.allocate(1);
93 allocator.construct(cache, *
this, alloc);
95 allocator.deallocate(cache, 1);
103 template <
template <
typename >
class ALLOC >
110 template <
template <
typename >
class ALLOC >
117 template <
template <
typename >
class ALLOC >
119 operator=(
const ScoringCache< ALLOC >& from) {
120 if (&from !=
this) { __scores = from.__scores; }
126 template <
template <
typename >
class ALLOC >
128 operator=(ScoringCache< ALLOC >&& from) {
129 if (&from !=
this) { __scores = std::move(from.__scores); }
135 template <
template <
typename >
class ALLOC >
138 __scores.insert(idset, score);
143 template <
template <
typename >
class ALLOC >
146 __scores.insert(std::move(idset), std::move(score));
151 template <
template <
typename >
class ALLOC >
153 __scores.erase(idset);
158 template <
template <
typename >
class ALLOC >
160 return __scores.exists(idset);
165 template <
template <
typename >
class ALLOC >
167 return __scores[idset];
172 template <
template <
typename >
class ALLOC >
179 template <
template <
typename >
class ALLOC >
181 return __scores.size();
virtual ~ScoringCache()
destructor
void erase(const IdSet< ALLOC > &idset)
removes a score (if it exists)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::size_t size() const
returns the number of scores saved in the cache
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
void clear()
removes all the stored scores
double score(const IdSet< ALLOC > &idset)
returns a given score
ScoringCache< ALLOC > & operator=(const ScoringCache< ALLOC > &from)
copy operator
void insert(const IdSet< ALLOC > &idset, double score)
insert a new score into the cache
ScoringCache(const allocator_type &alloc=allocator_type())
default constructor
virtual ScoringCache< ALLOC > * clone() const
virtual copy constructor
allocator_type getAllocator() const
returns the allocator used by the translator
bool exists(const IdSet< ALLOC > &idset)
indicates whether a given score exists
Size NodeId
Type for node ids.