Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. void CreateIndexMap()
  2. {
  3. shared_memory_object::remove(Getsharedmemoryregion());
  4. managed_shared_memory segment(create_only,Getsharedmemoryregion(), 10000000);
  5. void_allocator alloc_inst (segment.get_segment_manager());
  6. complex_map_type *mymap = segment.construct<complex_map_type>("MyMap")(std::less<char_string>(), alloc_inst);
  7. }
  8.  
  9. void UpdateIndexMap(std::string str, std::string index, const char* SharedMemory)
  10. {
  11. managed_shared_memory segment(open_only,SharedMemory);
  12. void_allocator alloc_inst (segment.get_segment_manager());
  13. complex_map_type *mymap = segment.find<complex_map_type>("MyMap").first;
  14. std::string h = ConvertTolowercase(str);
  15. char_string patternvalue(h.c_str(), alloc_inst);
  16. char_string indexvalue((index).c_str(), alloc_inst);
  17. mymap->insert(std::pair<char_string, char_string>(patternvalue,indexvalue));
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement