9#ifndef LLDB_CORE_UNIQUECSTRINGMAP_H 
   10#define LLDB_CORE_UNIQUECSTRINGMAP_H 
   36  typedef typename collection::iterator 
iterator;
 
   55    if (idx < 
m_map.size()) {
 
   56      value = 
m_map[idx].value;
 
 
   63    return m_map[idx].cstring;
 
 
   73    return m_map[idx].value;
 
 
   87    auto pos = llvm::lower_bound(
m_map, unique_cstr, 
Compare());
 
   88    if (pos != 
m_map.end() && pos->cstring == unique_cstr)
 
 
   99    auto pos = llvm::lower_bound(
m_map, unique_cstr, 
Compare());
 
  100    if (pos != 
m_map.end() && pos->cstring == unique_cstr)
 
 
  112    if (!
m_map.empty()) {
 
  113      const Entry *first_entry = &
m_map[0];
 
  114      const Entry *after_last_entry = first_entry + 
m_map.size();
 
  115      const Entry *next_entry = entry_ptr + 1;
 
  116      if (first_entry <= next_entry && next_entry < after_last_entry) {
 
  117        if (next_entry->cstring == entry_ptr->cstring)
 
 
  125    const size_t start_size = values.size();
 
  127    for (
const Entry &entry : llvm::make_range(std::equal_range(
 
  128             m_map.begin(), 
m_map.end(), unique_cstr, Compare())))
 
  129      values.push_back(entry.value);
 
  131    return values.size() - start_size;
 
 
  135                   std::vector<T> &values)
 const {
 
  136    const size_t start_size = values.size();
 
  139    for (pos = 
m_map.begin(); pos != 
end; ++pos) {
 
  140      if (regex.
Execute(pos->cstring.GetCString()))
 
  141        values.push_back(pos->value);
 
  144    return values.size() - start_size;
 
 
  169    Sort([](
const T &, 
const T &) { 
return false; });
 
 
  174  template <
typename TCompare> 
void Sort(TCompare tc) {
 
  176    llvm::sort(
m_map, [&](
const Entry &lhs, 
const Entry &rhs) -> 
bool {
 
  177      int result = c.ThreeWay(lhs.cstring, rhs.cstring);
 
  179        return tc(lhs.value, rhs.value);
 
 
  202  llvm::iterator_range<const_iterator>
 
  204    return llvm::make_range(
 
  205        std::equal_range(
m_map.begin(), 
m_map.end(), unique_cstr, Compare()));
 
 
 
static bool Compare(BreakpointLocationSP lhs, lldb::break_id_t val)
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
ConstString GetCStringAtIndexUnchecked(uint32_t idx) const
llvm::iterator_range< const_iterator > equal_range(ConstString unique_cstr) const
size_t GetValues(ConstString unique_cstr, std::vector< T > &values) const
const T & GetValueRefAtIndexUnchecked(uint32_t idx) const
ConstString GetCStringAtIndex(uint32_t idx) const
const Entry * FindFirstValueForName(ConstString unique_cstr) const
bool GetValueAtIndex(uint32_t idx, T &value) const
T GetValueAtIndexUnchecked(uint32_t idx) const
void Sort(TCompare tc)
Sort contents of this map using the provided comparator to break ties for entries with the same strin...
T Find(ConstString unique_cstr, T fail_value) const
const_iterator end() const
const Entry * FindNextValueForName(const Entry *entry_ptr) const
std::vector< Entry > collection
collection::const_iterator const_iterator
const_iterator begin() const
void Append(const Entry &e)
size_t GetValues(const RegularExpression ®ex, std::vector< T > &values) const
collection::iterator iterator
void Append(ConstString unique_cstr, const T &value)
A class that represents a running process on the host machine.
bool operator()(ConstString lhs, const Entry &rhs)
bool operator()(const Entry &lhs, ConstString rhs)
bool operator()(ConstString lhs, ConstString rhs)
int ThreeWay(ConstString lhs, ConstString rhs)
bool operator()(const Entry &lhs, const Entry &rhs)
Entry(ConstString cstr, const T &v)