00001 00012 #ifndef SYMBOL_CONTAINER_H 00013 #define SYMBOL_CONTAINER_H 00014 00015 #include <string> 00016 #include <set> 00017 00018 #include "symbol.h" 00019 #include "symbol_functors.h" 00020 00028 class symbol_container { 00029 public: 00031 typedef std::set<symbol_entry, less_symbol> symbols_t; 00032 00033 typedef symbols_t::size_type size_type; 00034 00036 size_type size() const; 00037 00047 symbol_entry const * insert(symbol_entry const &); 00048 00050 symbol_collection const find(debug_name_id filename, size_t linenr) const; 00051 00053 symbol_collection const find(debug_name_id filename) const; 00054 00056 symbol_entry const * find_by_vma(std::string const & image_name, 00057 bfd_vma vma) const; 00058 00060 symbol_entry const * find(symbol_entry const & symbol) const; 00061 00063 symbols_t::iterator begin(); 00064 00066 symbols_t::iterator end(); 00067 00068 private: 00070 void build_by_loc() const; 00071 00076 symbols_t symbols; 00077 00082 typedef std::multiset<symbol_entry const *, less_by_file_loc> 00083 symbols_by_loc_t; 00084 00085 // must be declared after the set to ensure a correct life-time. 00086 00091 mutable symbols_by_loc_t symbols_by_loc; 00092 }; 00093 00094 #endif /* SYMBOL_CONTAINER_H */