diff --git a/src/SerializedTypes.h b/src/SerializedTypes.h index db4e8d2ba2..b1ce80eedb 100644 --- a/src/SerializedTypes.h +++ b/src/SerializedTypes.h @@ -584,18 +584,55 @@ public: void add(Serializer& s) const; virtual Json::Value getJson(int) const; - SerializedTypeID getSType() const { return STI_PATHSET; } - int getPathCount() const { return value.size(); } - const STPath& getPath(int off) const { return value[off]; } - STPath& peekPath(int off) { return value[off]; } - bool isEmpty() const { return value.empty(); } - void clear() { value.clear(); } - void addPath(const STPath& e) { value.push_back(e); } + SerializedTypeID getSType() const { return STI_PATHSET; } + int getPathCount() const { return value.size(); } + const STPath& getPath(int off) const { return value[off]; } + STPath& peekPath(int off) { return value[off]; } + bool isEmpty() const { return value.empty(); } + void clear() { value.clear(); } + void addPath(const STPath& e) { value.push_back(e); } + std::vector::iterator begin() { return value.begin(); } + std::vector::iterator end() { return value.end(); } std::vector::const_iterator begin() const { return value.begin(); } std::vector::const_iterator end() const { return value.end(); } }; +inline std::vector::iterator range_begin(STPathSet & x) +{ + return x.begin(); +} + +inline std::vector::iterator range_end(STPathSet & x) +{ + return x.end(); +} + +inline std::vector::const_iterator range_begin(const STPathSet& x) +{ + return x.begin(); +} + +inline std::vector::const_iterator range_end(const STPathSet& x) +{ + return x.end(); +} + +namespace boost +{ + template<> + struct range_mutable_iterator< STPathSet > + { + typedef std::vector::iterator type; + }; + + template<> + struct range_const_iterator< STPathSet > + { + typedef std::vector::const_iterator type; + }; +} + class STTaggedList : public SerializedType { protected: