1 // file : RolyPoly/LogStdMap.h
2 // author : Boris Kolpackov <boris@dre.vanderbilt.edu>
8 template <typename RI
, typename RV
>
12 typedef RI RecordIdType
;
13 typedef RV RecordValueType
;
17 std::map
<RecordIdType
, RecordValueType
>
25 insert (RecordIdType
const& ri
, RecordValueType
const& rv
)
27 if (!map_
.insert (std::make_pair (ri
, rv
)).second
)
34 contains (RecordIdType
const& ri
) const
36 return map_
.count (ri
) != 0;
40 RecordValueType
const&
41 lookup (RecordIdType
const& ri
) const
43 typename
Map_::const_iterator i
= map_
.find (ri
);
45 if (i
!= map_
.end ()) return i
->second
;
46 else throw NotFound ();
53 #endif // LOG_STD_MAP_H