00001 #ifndef SIMGEAR_STRINGTABLE_HXX 00002 #define SIMGEAR_STRINGTABLE_HXX 1 00003 00004 #include <string> 00005 00006 #include <OpenThreads/Mutex> 00007 #include <boost/multi_index_container.hpp> 00008 #include <boost/multi_index/hashed_index.hpp> 00009 #include <boost/multi_index/identity.hpp> 00010 00011 namespace simgear 00012 { 00013 typedef boost::multi_index_container< 00014 std::string, 00015 boost::multi_index::indexed_by< 00016 boost::multi_index::hashed_unique< 00017 boost::multi_index::identity<std::string> > > > 00018 StringContainer; 00019 00020 class StringTable 00021 { 00022 const std::string* insert(const std::string& str); 00023 private: 00024 OpenThreads::Mutex _mutex; 00025 StringContainer _strings; 00026 }; 00027 } 00028 #endif