void ClicDb::set(const std::string& usr, const std::set<std::string>& locations) { std::stringstream ss; printLocations(ss, locations); std::string locationsString = ss.str(); Dbt key(const_cast<char*>(usr.c_str()), usr.size()); Dbt value(const_cast<char*>(locationsString.c_str()), locationsString.size()); db.put(NULL, &key, &value, 0); }
//prints out the results for the canReachInN function // with values of n from 0 to 3, from all //starting locations, via all transport types void showCanReach(Graph g){ int n, t; Location loc; for(n = 0; n <= 3; n++){ printf("n is %d\n", n); for(loc = 0; loc < NUM_MAP_LOCATIONS; loc++){ for(t = LAND; t <= ANY; t++){ Location locations[NUM_MAP_LOCATIONS] = {0}; canReachInN(g, loc, t, n, locations); printLocations(locations); } } } }