Hi there, I am having a problem with Boost.MultiIndex (I'm using Boost 1.37). So the problem is the following: I am using a static data structure, an index which I use as my graph repository: /// Data member to represent the graph repository (using ordered_unique index) static graphIndex _graphRep; which is from the type graphIndex: ///ordered_unique Index in the data structure graph_hm typedef multi_index_container< graphMap, indexed_by< ordered_unique< BOOST_MULTI_INDEX_MEMBER(graphMap,string,_name) > >
graphIndex;
Here is the graphMap:
/// GraphMap: Data Structure for setting an index in the uniqueGraphName and retrieving handler Graph_h
struct graphMap {
string _name;
Graph _graph;
/// Default Constructor
graphMap(){}
/// Constructor with parameters: initialize the name and graph
graphMap(string uniqueGraphName, Graph graph) :
_name(uniqueGraphName), _graph (graph) {}
/// Constructor with parameters: initialize the name and graph
graphMap(const graphMap &gm) : _name(gm._name), _graph (gm._graph) {}
};
For manipulating the graphs, I use a Graph_h (handler), which does a copy from the graph from this repository, does the changes in the local copy, and then the user has to call commitChanges(); to apply it in the repository (which I am using the replace function from the MultiIndex to commit it).
The problem it is that inside the commitChanges(); I can retrieve from the repository through the find function (from MultiIndex).
But when I the main program, it does not work (remark: I am trying right after calling the commitChanges();
It founds the graph, but it seems to be the old one, and I cannot retrieve the nodes...
Why is that happening?
Here it is a stretch of code from the main:
//Test of the commit
if (graph_h.commitChanges())
cout << "Commit was successful!\n";
else
cout << "Commit was unsuccessful!\n";
// Debug
//Graph_h graph_h;
//NodeIterator nodeIt;
//Node_h node_h;
graphIt it = DynamicGraphs::_graphRep.find("COI:0351-123-4555");
graph_h = Graph_h(it);
//propertystream_h propS;
propS = graph_h->lookupLocalProp("name");
p_h = propS.next();
cout << "DEBUG@main:right after the commit:_git " << p_h.value() <