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_
17 // Other libraries and framework includes
19 #include "lldb/lldb-public.h"
20 #include "lldb/Core/ConstString.h"
21 #include "lldb/Host/Mutex.h"
22 #include "lldb/DataFormatters/FormatClasses.h"
24 namespace lldb_private {
31 bool m_format_cached : 1;
32 bool m_summary_cached : 1;
33 bool m_synthetic_cached : 1;
35 lldb::TypeFormatImplSP m_format_sp;
36 lldb::TypeSummaryImplSP m_summary_sp;
37 lldb::SyntheticChildrenSP m_synthetic_sp;
40 Entry (lldb::TypeFormatImplSP);
41 Entry (lldb::TypeSummaryImplSP);
42 Entry (lldb::SyntheticChildrenSP);
43 Entry (lldb::TypeFormatImplSP,lldb::TypeSummaryImplSP,lldb::SyntheticChildrenSP);
54 lldb::TypeFormatImplSP
57 lldb::TypeSummaryImplSP
60 lldb::SyntheticChildrenSP
64 SetFormat (lldb::TypeFormatImplSP);
67 SetSummary (lldb::TypeSummaryImplSP);
70 SetSynthetic (lldb::SyntheticChildrenSP);
72 typedef std::map<ConstString,Entry> CacheMap;
76 uint64_t m_cache_hits;
77 uint64_t m_cache_misses;
80 GetEntry (const ConstString& type);
86 GetFormat (const ConstString& type,lldb::TypeFormatImplSP& format_sp);
89 GetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp);
92 GetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp);
95 SetFormat (const ConstString& type,lldb::TypeFormatImplSP& format_sp);
98 SetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp);
101 SetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp);
115 return m_cache_misses;
118 } // namespace lldb_private
120 #endif // lldb_FormatCache_h_