Leaf::getInfo () now returns boost::shared_ptr<const NameInfo> instead of NameInfo reference as before.
SyncLogic is temporarily broken
diff --git a/model/sync-state-leaf-container.h b/model/sync-state-leaf-container.h
index 9ae98b0..7111ff6 100644
--- a/model/sync-state-leaf-container.h
+++ b/model/sync-state-leaf-container.h
@@ -42,9 +42,27 @@
struct NameInfoHash : public std::unary_function<NameInfo, std::size_t>
{
std::size_t
- operator() (const NameInfo &prefix) const
+ operator() (NameInfoConstPtr prefix) const
{
- return prefix.getHashId ();
+ return prefix->getHashId ();
+ }
+};
+
+struct NameInfoEqual : public std::unary_function<NameInfo, std::size_t>
+{
+ bool
+ operator() (NameInfoConstPtr prefix1, NameInfoConstPtr prefix2) const
+ {
+ return *prefix1 == *prefix2;
+ }
+};
+
+struct NameInfoCompare : public std::unary_function<NameInfo, std::size_t>
+{
+ bool
+ operator() (NameInfoConstPtr prefix1, NameInfoConstPtr prefix2) const
+ {
+ return *prefix1 < *prefix2;
}
};
@@ -63,13 +81,16 @@
// For fast access to elements using NameInfo
mi::hashed_unique<
mi::tag<hashed>,
- mi::const_mem_fun<Leaf, const NameInfo&, &Leaf::getInfo>,
- NameInfoHash
+ mi::const_mem_fun<Leaf, NameInfoConstPtr, &Leaf::getInfo>,
+ NameInfoHash,
+ NameInfoEqual
>,
- mi::ordered_unique<
- mi::tag<ordered>,
- mi::const_mem_fun<Leaf, const NameInfo&, &Leaf::getInfo>
- >
+
+ mi::ordered_unique<
+ mi::tag<ordered>,
+ mi::const_mem_fun<Leaf, NameInfoConstPtr, &Leaf::getInfo>,
+ NameInfoCompare
+ >
>
>
{