1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
struct ObjectUtil
{
Object* _obj;
int _start;
int _end;
ObjectUtil(Object* obj_,
int start_,
int end_ )
{
this->_obj = obj_;
this->_start = start_;
this->_end = end_;
}
};
namespace obj_tags
{
struct tag_obj{};
struct tag_start{};
struct tag_end{};
struct tag_both_index{};
}
using sort_objects = boost::multi_index_container<
ObjectUtil,
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<
boost::multi_index::tag<obj_tags::tag_obj>,
boost::multi_index::member<ObjectUtil, Object*, &ObjectUtil::_obj>,
std::less<Object*>
>,
boost::multi_index::ordered_non_unique<
boost::multi_index::tag<obj_tags::tag_start>,
boost::multi_index::member<ObjectUtil, int, &ObjectUtil::_start>,
std::less<int>
>,
boost::multi_index::ordered_non_unique<
boost::multi_index::tag<obj_tags::tag_end>,
boost::multi_index::member<ObjectUtil, int, &ObjectUtil ::_end>,
std::less<int>
>,
boost::multi_index::ordered_non_unique<
boost::multi_index::tag<obj_tags::tag_both_index>,
boost::multi_index::composite_key<ObjectUtil,
boost::multi_index::member<ObjectUtil, int, &ObjectUtil::_start>,
boost::multi_index::member<ObjectUtil, int, &ObjectUtil::_end>
>
>
>
>;
|