boost-multi-index

Boost::Multi-index for nested lists

不想你离开。 提交于 2021-02-11 13:10:13
问题 How to implement Boost::Multi-index on a list of lists I have a hierarchical tree as follows: typedef std::list<struct obj> objList // the object list typedef std::list<objList> topLevelList // the list of top-level object lists struct obj { int Id; // globally unique Id std::string objType; std::string objAttributes; .... topLevelList childObjectlist; } At the top-level, I have a std::list of struct obj Then, each of these top-level obj can have any number of child objects, which are

How to implement Boost::Serialize for Boost::Nested_Container

匆匆过客 提交于 2020-03-05 06:04:29
问题 (Followup of another question.) Boost::Serialize often delivers an exception on oarchive, complaining that re-creating a particular object would result in duplicate objects. Some archives save and re-load successfully, but many result in the error above. I have not been able yet to determine the exact conditions under which the error occurs, but I have proven that none of the content used to populate the nested_container and the flat object list contains duplicate object IDs. I am using text

equal_range in boost::multi_index_container composite key with comparision operator

江枫思渺然 提交于 2020-01-11 12:03:10
问题 I'm trying to query results from a multi index container where the value type is a struct of three elements. The first value is given, but the second and third have to be greater or less than a query parameter. After searching around, I found that a custom Key extractor has to be implemented, and some of the links here suggest the same, but I am unable to implement it: boost::multi_index user-defined key extractor and composite key https://www.boost.org/doc/libs/1_62_0/libs/multi_index/test

equal_range in boost::multi_index_container composite key with comparision operator

此生再无相见时 提交于 2020-01-11 12:02:13
问题 I'm trying to query results from a multi index container where the value type is a struct of three elements. The first value is given, but the second and third have to be greater or less than a query parameter. After searching around, I found that a custom Key extractor has to be implemented, and some of the links here suggest the same, but I am unable to implement it: boost::multi_index user-defined key extractor and composite key https://www.boost.org/doc/libs/1_62_0/libs/multi_index/test

equal_range in boost::multi_index_container composite key with comparision operator

ⅰ亾dé卋堺 提交于 2020-01-11 12:01:10
问题 I'm trying to query results from a multi index container where the value type is a struct of three elements. The first value is given, but the second and third have to be greater or less than a query parameter. After searching around, I found that a custom Key extractor has to be implemented, and some of the links here suggest the same, but I am unable to implement it: boost::multi_index user-defined key extractor and composite key https://www.boost.org/doc/libs/1_62_0/libs/multi_index/test

boost::multi_index_container, operations on std::set inside container

一个人想着一个人 提交于 2020-01-11 07:08:27
问题 I've created a boost::multi_index_container ( containerSet ) over a container class and indexed the containerSet by std::string and std::set<int> . Is it possible to get the container, which store a specific int inside their set? Furthermore is it possible to get all container, which store at least one value between int1 and int2 within their set? #include <boost/multi_index_container.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost

boost multi_index_container and slow operator++

那年仲夏 提交于 2019-12-25 04:46:20
问题 It is follow-up question for this MIC question. When adding items to the vector of reference wrappers I spend about 80% of time inside ++ operator whatever iterating approach I choose. The query works as following VersionView getVersionData(int subdeliveryGroupId, int retargetingId, const std::wstring &flightName) const { VersionView versions; for (auto i = 0; i < 3; ++i) { for (auto j = 0; j < 3; ++j) { versions.insert(m_data.get<mvKey>().equal_range(boost::make_tuple(subdeliveryGroupId + i,

How to add the ordered unique index specifies in multi_index_container

梦想的初衷 提交于 2019-12-24 15:42:19
问题 I'm using boost:multi_index_container. following is the code #include <string> #include <boost/multi_index_container.hpp> #include "boost/multi_index/global_fun.hpp" #include "boost/multi_index/hashed_index.hpp" #include <boost/multi_index/sequenced_index.hpp> #include "boost/multi_index/mem_fun.hpp" #include "boost/multi_index/member.hpp" #include "boost/multi_index/ordered_index.hpp" #include "boost/multi_index/indexed_by.hpp" using namespace std; class uri { public: string str; uri(string

boost multi_index iterator's validity status after erasure in inner loop

久未见 提交于 2019-12-24 15:04:01
问题 Is this legal? I.e., is the outer iterator range0.first invalidated by erasing stuff using the inner iterator range1.first ? Thanks! #include <boost/multi_index_container.hpp> #include <boost/multi_index/sequenced_index.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/random_access_index.hpp> #include <boost/multi_index/member.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/composite_key.hpp> #include <string> #include <iostream>

Find boost multi index Tag to index and number of indices

丶灬走出姿态 提交于 2019-12-24 02:28:10
问题 I have a template class(CrMultiIndex) that receive as template parameter a definition of boost multi index(GlobalHash). I need : To add statistics to my template class according to Index used. So i need a way to resize the vector(m_StatsByIndex) at init with the number of existing indices. I still want the user to search according to tag and not index number. So i need a way to convert from tag to index number so i can update statistics in vector according to index in vector. I have template