I have no difficulty creating a TMap object (map), and filling it with
a small set of (key, value) pairs. For testing, the "key" and "value"
objects are TObjString's. After opening a new file, I invoke the
method map->Write(). A listing of the directory shows I saved a
TObjString and not a TMap. What went wrong?
root [0] TMap map(10)
root [1] map.Add(new TObjString("Mike"), new TObjString("Beddo"))
root [2] map
(class TMap)542047224
root [3] TFile db("test.root", "recreate")
root [4] map->Write("a_map")
root [5] .ls()
TFile** test.root
TFile* test.root
KEY: TObjString a_map;1 Collectable string class
root [6] .q
- Mike Beddo