Teach BOOST_FOREAECH how to traverse this type.

This commit is contained in:
JoelKatz
2012-10-24 15:42:16 -07:00
parent 26fc57b13c
commit 3b42e66c08

View File

@@ -123,14 +123,24 @@ public:
void calcRawMeta(Serializer&, TER result);
// iterator functions
typedef std::map<uint256, LedgerEntrySetEntry>::iterator iterator;
typedef std::map<uint256, LedgerEntrySetEntry>::const_iterator const_iterator;
bool isEmpty() const { return mEntries.empty(); }
std::map<uint256, LedgerEntrySetEntry>::const_iterator begin() const { return mEntries.begin(); }
std::map<uint256, LedgerEntrySetEntry>::const_iterator end() const { return mEntries.end(); }
std::map<uint256, LedgerEntrySetEntry>::iterator begin() { return mEntries.begin(); }
std::map<uint256, LedgerEntrySetEntry>::iterator begin() { return mEntries.begin(); }
std::map<uint256, LedgerEntrySetEntry>::iterator end() { return mEntries.end(); }
static bool intersect(const LedgerEntrySet& lesLeft, const LedgerEntrySet& lesRight);
};
inline LedgerEntrySet::iterator range_begin(LedgerEntrySet& x) { return x.begin(); }
inline LedgerEntrySet::iterator range_end(LedgerEntrySet &x) { return x.end(); }
namespace boost
{
template<> struct range_mutable_iterator<LedgerEntrySet> { typedef LedgerEntrySet::iterator type; };
template<> struct range_const_iterator<LedgerEntrySet> { typedef LedgerEntrySet::const_iterator type; };
}
#endif
// vim:ts=4