12 #ifndef MAPPED_PTR_VECTOR_H
13 #define MAPPED_PTR_VECTOR_H
28 template <
typename T,
typename StringCompareT = std::less<std::
string> >
34 typedef std::map<std::string, std::pair<unsigned int, unsigned int>,
35 StringCompareT > tIndex;
39 std::vector<T*> _vector;
41 std::string _currentName;
42 std::pair<unsigned int, unsigned int> _currentIndices;
44 bool is_equal(
const std::string& first,
const std::string& second,
45 const typename tIndex::key_compare& keyComp)
const;
55 unsigned int size()
const;
61 void push_back(T* inP,
const unsigned int fileIndex = 0);
62 void push_back(
const std::string& name,
const unsigned int fileIndex = 0);
63 void push_back(
const std::vector<std::string>& names,
64 const std::vector<unsigned int>& fileIndices);
65 void push_back(
const std::vector<std::string>& names);
74 unsigned int find(
const std::string& name);
76 void rename(
const std::string& oldName,
const std::string& newName);
79 void erase(
const std::string& name);
82 bool is_read(
const std::string& name);
85 void read(
const std::string& name);
88 unsigned int write(
const std::string& name);
90 std::pair<unsigned int, unsigned int>
get_indices(
const std::string& name);
91 std::string
get_name(
const unsigned int index);