1 //===-- FormatCache.h ---------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_FormatCache_h_
11 #define lldb_FormatCache_h_
18 // Other libraries and framework includes
20 #include "lldb/lldb-public.h"
21 #include "lldb/Core/ConstString.h"
23 namespace lldb_private {
30 bool m_format_cached : 1;
31 bool m_summary_cached : 1;
32 bool m_synthetic_cached : 1;
33 bool m_validator_cached : 1;
35 lldb::TypeFormatImplSP m_format_sp;
36 lldb::TypeSummaryImplSP m_summary_sp;
37 lldb::SyntheticChildrenSP m_synthetic_sp;
38 lldb::TypeValidatorImplSP m_validator_sp;
41 Entry (lldb::TypeFormatImplSP);
42 Entry (lldb::TypeSummaryImplSP);
43 Entry (lldb::SyntheticChildrenSP);
44 Entry (lldb::TypeValidatorImplSP);
45 Entry (lldb::TypeFormatImplSP,lldb::TypeSummaryImplSP,lldb::SyntheticChildrenSP,lldb::TypeValidatorImplSP);
59 lldb::TypeFormatImplSP
62 lldb::TypeSummaryImplSP
65 lldb::SyntheticChildrenSP
68 lldb::TypeValidatorImplSP
72 SetFormat (lldb::TypeFormatImplSP);
75 SetSummary (lldb::TypeSummaryImplSP);
78 SetSynthetic (lldb::SyntheticChildrenSP);
81 SetValidator (lldb::TypeValidatorImplSP);
83 typedef std::map<ConstString,Entry> CacheMap;
85 std::recursive_mutex m_mutex;
87 uint64_t m_cache_hits;
88 uint64_t m_cache_misses;
91 GetEntry (const ConstString& type);
97 GetFormat (const ConstString& type,lldb::TypeFormatImplSP& format_sp);
100 GetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp);
103 GetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp);
106 GetValidator (const ConstString& type,lldb::TypeValidatorImplSP& summary_sp);
109 SetFormat (const ConstString& type,lldb::TypeFormatImplSP& format_sp);
112 SetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp);
115 SetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp);
118 SetValidator (const ConstString& type,lldb::TypeValidatorImplSP& synthetic_sp);
132 return m_cache_misses;
135 } // namespace lldb_private
137 #endif // lldb_FormatCache_h_