@@ -33,36 +33,22 @@ class FormatCache {
3333
3434 public:
3535 Entry ();
36- Entry (lldb::TypeFormatImplSP);
37- Entry (lldb::TypeSummaryImplSP);
38- Entry (lldb::SyntheticChildrenSP);
39- Entry (lldb::TypeValidatorImplSP);
40- Entry (lldb::TypeFormatImplSP, lldb::TypeSummaryImplSP,
41- lldb::SyntheticChildrenSP, lldb::TypeValidatorImplSP);
4236
37+ template <typename ImplSP> bool IsCached ();
4338 bool IsFormatCached ();
44-
4539 bool IsSummaryCached ();
46-
4740 bool IsSyntheticCached ();
48-
4941 bool IsValidatorCached ();
5042
51- lldb::TypeFormatImplSP GetFormat ();
52-
53- lldb::TypeSummaryImplSP GetSummary ();
54-
55- lldb::SyntheticChildrenSP GetSynthetic ();
56-
57- lldb::TypeValidatorImplSP GetValidator ();
58-
59- void SetFormat (lldb::TypeFormatImplSP);
60-
61- void SetSummary (lldb::TypeSummaryImplSP);
62-
63- void SetSynthetic (lldb::SyntheticChildrenSP);
43+ void Get (lldb::TypeFormatImplSP &);
44+ void Get (lldb::TypeSummaryImplSP &);
45+ void Get (lldb::SyntheticChildrenSP &);
46+ void Get (lldb::TypeValidatorImplSP &);
6447
65- void SetValidator (lldb::TypeValidatorImplSP);
48+ void Set (lldb::TypeFormatImplSP);
49+ void Set (lldb::TypeSummaryImplSP);
50+ void Set (lldb::SyntheticChildrenSP);
51+ void Set (lldb::TypeValidatorImplSP);
6652 };
6753 typedef std::map<ConstString, Entry> CacheMap;
6854 CacheMap m_map;
@@ -76,32 +62,19 @@ class FormatCache {
7662public:
7763 FormatCache ();
7864
79- bool GetFormat (ConstString type, lldb::TypeFormatImplSP &format_sp);
80-
81- bool GetSummary (ConstString type, lldb::TypeSummaryImplSP &summary_sp);
82-
83- bool GetSynthetic (ConstString type,
84- lldb::SyntheticChildrenSP &synthetic_sp);
85-
86- bool GetValidator (ConstString type,
87- lldb::TypeValidatorImplSP &summary_sp);
88-
89- void SetFormat (ConstString type, lldb::TypeFormatImplSP &format_sp);
90-
91- void SetSummary (ConstString type, lldb::TypeSummaryImplSP &summary_sp);
92-
93- void SetSynthetic (ConstString type,
94- lldb::SyntheticChildrenSP &synthetic_sp);
95-
96- void SetValidator (ConstString type,
97- lldb::TypeValidatorImplSP &synthetic_sp);
65+ template <typename ImplSP> bool Get (ConstString type, ImplSP &format_impl_sp);
66+ void Set (ConstString type, lldb::TypeFormatImplSP &format_sp);
67+ void Set (ConstString type, lldb::TypeSummaryImplSP &summary_sp);
68+ void Set (ConstString type, lldb::SyntheticChildrenSP &synthetic_sp);
69+ void Set (ConstString type, lldb::TypeValidatorImplSP &synthetic_sp);
9870
9971 void Clear ();
10072
10173 uint64_t GetCacheHits () { return m_cache_hits; }
10274
10375 uint64_t GetCacheMisses () { return m_cache_misses; }
10476};
77+
10578} // namespace lldb_private
10679
10780#endif // lldb_FormatCache_h_
0 commit comments